If you already have remote access (via an IP port) to a running, stable MySQL server you don't need to perform this step and can move onto the next step.
Otherwise, you need to install MySQL and get it set up. The easiest way to do this is to follow the instructions at MySQL.com. They have a nice document set up that explains how to install MySQL.
Links:
Direct Link to Installation section of MySQL manual
Link to MySQL documentation page
For the rest of the BioCoRE server installation, we will assume that:
- The MySQL server has been installed and is currently working.
- It is set up to be running anytime that BioCoRE is running. This is usually done by setting up the MySQL daemon to automatically start when the machine boots.
mysqlInstead, they have had to explicitly tell the mysql client to use the IP-based connection method via:
mysql -h my.machine.name(Note that just saying -h localhost is likely to not work)
If this is the case with your install, you will need to add the -h my.machine.name anywhere else in these instructions that tell you to start a mysql client.
If you have used the MySQL documentation to get a MySQL server running, you can move onto the next step.
Next Step: Adding the BioCoRE database to MySQL.
We have written documentation on installing MySQL that you are welcome to peruse. This was originally written with the intent of simplifying the installation of MySQL. However, there are so many possible situations that can arise during a MySQL installation that we are now suggesting that users go to the MySQL site for installation instructions. But, the information below might be helpful for those who are going through the process.
We suggest that you install this as a special database user in a
different area of the filesystem than the main BioCoRE package. This
might be /usr/local/dbms
, or /opt/mysql
or
any other place. For the purposes of this document, though, we are
going to call it $DBMS_HOME.
EVERYWHERE YOU SEE $DBMS_HOME REPLACE IT WITH YOUR CHOSEN
DIRECTORY.
Most of these instructions don't have to be explicitly followed and you
are free to modify them as long as you know what you are doing. We
suggest that you skim through the instructions before actually starting
the work. We also suggest that you choose the biggest possible disk to
store the database on. The initial database isn't terribly big, but
since most of the BioCoRE information is stored in the database this
area will grow as time goes on. The base install on Linux using RPMs
with an empty database is around 20 megabytes.
If you are on Linux, you can probably use a package (such as RPM's for both server and client) to install MySQL. Feel free to install the RPMs and browse the following down to the point where you "Start the server for the first time!" and continue from that point. Note that you can ignore the parts of the examples that specify a defaults-file if you use RPMs to install. Give the same commands without the --defaults-file.
Go to the $DBMS_HOME directory and, as the special database user, untar the MySQL tarball that you downloaded at the download page. For these examples, we are going to say that we are installing version 3.23.46 (newer versions might be available when you read this, and you should use the newer versions).
This will create a directory (for our version on our platform; your's will probably have a different name) named:
mysql-3.23.46-sun-solaris2.7-sparcThen,
ln -s mysql-3.23.46-sun-solaris2.7-sparc mysqlIn addition, in the $DBMS_HOME directory, create a directory called '
scripts
' and a
directory called 'data
'. 'scripts
' will
contain modified versions of the startup files that MySQL needs and the
actual databases will be stored in 'data
'.
Go to the mysql/support-files
directory, and browse the
my-*.cnf files and decide on the one that is appropriate for your
system. There are different levels of files depending on how big a
machine you are using. For most people, my-small.cnf
or
my-medium.cnf
works well. For the following example, we
are using my-medium.cnf
. Copy the
my-medium.cnf
(renaming it to my.cnf
) and
mysql.server
files from support-files
into
the 'scripts
' directory that you created using the
following commands:
>cp mysql/support-files/mysql.server $DBMS_HOME/scripts >cp mysql/support-files/my-medium.cnf $DBMS_HOMEscripts/my.cnf
Edit the my.cnf
file in the scripts directory:
[client]
section and the [mysqld]
section.
[mysqld]
section:
datadir=$DBMS_HOME/data basedir=$DBMS_HOME/mysql log log-update
Edit the mysql.server
file in the scripts
directory:
These changes might not be necessary if you have installed from an RPM on Linux.
# Set some defaults datadir=$DBMS_HOME/data basedir=$DBMS_HOME/mysql conffile=$DBMS_HOME/scripts/my.cnf mysql_daemon_user=DBMSUSER # Run mysqld as this user pid_file=
@HOSTNAME@
to hostname
(might not be required
for newer versions of MySQL)
my.cnf
using my_print_defaults to the following (we have added the -c
$conffile
):
parse_arguments `$print_defaults -c $conffile $defaults mysqld mysql_server`
safe_mysqld
so that
it starts as the user specified with the correct configuration
file.Add :
--user=$mysql_daemon_userto the line (it needs to be right after
$bindir/safe_mysqld
and before the other options).
NOTE: Try the above first. When you get down below to where the instructions have you run mysql.server for the first time, if it appears that mysql isn't using the port numbers, etc that you have set in the defaults file, then change the line above so that it looks like the following instead:
--defaults-file=$conffile --user=$mysql_daemon_user(ie., add a parameter that passes in the defaults file.)
mysql.server
file to be executable (711 is
good enough)
Create MySQL utility tables
You will need to install the proper grant tables, etc by runningmysql_install_db
from the scripts directory of the
mysql
subdir.
Note: For Solaris you will need to make
a change to the install script (
$DBMS_HOME/mysql/scripts/mysql_install_db
).
Change the execdir from 'libexec
' to 'bin
'.
(This might not be necessary for newer versions of MySQL)
Change to the mysql
directory and run the script by saying:
> pwd $DBMS_HOME/mysql > scripts/mysql_install_db \ --defaults-file=$DBMS_HOME/scripts/my.cnf
Verify permissions
Set up permissions. This assumes that you have a unix user (DBMSUSER) in a special unix group (DBMSUSERGROUP) that is going to be running the MySQL daemon:chown -R DBMSUSER $DBMS_HOME chown -R DBMSUSER $DBMS_HOME/data chgrp -R DBMSUSERGROUP $DBMS_HOME/ chgrp -R DBMSUSERGROUP $DBMS_HOME/mysql/bin
Start the server for the first time!
$DBMS_HOME/scripts/mysql.server start
ROOTPASS
. You should set
it to something more secure:
$DBMS_HOME/mysql/bin/mysqladmin \ --defaults-file=$DBMS_HOME/scripts/my.cnf \ -u root -p password 'ROOTPASS'(Just hit enter if it asks you for a password)
(Note: if you used an RPM on Linux to install MySQL, the above command would be more like:
mysqladmin -u root -p password 'ROOTPASS')
$DBMS_HOME/mysql/bin/mysql \ --defaults-file=$DBMS_HOME/scripts/my.cnf -u root -pand enter the root password.
show databases;
' (the semicolon is important in
MySQL) tells us that we have a test database. We don't need that.
Get rid of it with 'drop database test;
'. Leave the mysql
database.
Really start the server
$DBMS_HOME/scripts/mysql.server stop su cp $DBMS_HOME/scripts/mysql.server /etc/init.d/mysql.biocore_local_server cd /etc/rc3.d ln -s ../init.d/mysql.biocore_local_server S95mysqlLocaland restart the server with:
/etc/init.d/mysql.biocore_local_server start
Next Step: Adding the BioCoRE database.
Back to the installation page
Feedback
The BioCoRE team welcomes any comments, questions, or suggestions that you might have concerning our software! Please email us or fill out our feedback form.