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.


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.
In some cases, after users have installed mysql according to the documentation at mysql.com they haven't been able to get the mysql client to connect to the mysql server by simply running the command:
Instead, 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:

ln -s mysql-3.23.46-sun-solaris2.7-sparc mysql
In 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:

  • Change the port from the default just to make it a little harder for hackers to discover (security by obscurity; although I trust MySQL, why make it easy on hackers?) Decide on a port that you want to use. The default port is 3306. We'll say that you are going to change it to 4306. (If you don't run the MySQL server as user root (and we suggest that you do not run it as root), you have to choose a port greater than or equal to 1024) Change port from 3306 to 4306 in both the [client] section and the [mysqld] section.
  • add the following lines to the [mysqld] section:

    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 default variables (DBMSUSER is the special Unix username that you are going to be using to run MySQL. This user must have an account on the Unix system. We suggest creating a new user account who's purpose will be strictly to run MySQL.) :
    # Set some defaults
    mysql_daemon_user=DBMSUSER     # Run mysqld as this user               
  • (Ignore this change for now. When you get down below to where the instructions have you run mysql.server for the first time, if you have errors about 'hostname's, make this change) For some versions of mysql on Solaris and Linux, in the test for the pid_file, change @HOSTNAME@ to hostname (might not be required for newer versions of MySQL)
  • Edit the line that gets the information from 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`
  • For some versions of mysql on Solaris you will edit the line in the 'start' case that actually runs safe_mysqld so that it starts as the user specified with the correct configuration file.
    Add :
    to 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.)

  • Chmod the 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 running mysql_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
    > scripts/mysql_install_db \

    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/data
    chgrp -R DBMSUSERGROUP $DBMS_HOME/mysql/bin

    Start the server for the first time!

  • If you installed on Linux using an RPM, the server should already have been started. Otherwise, start the server running with:
    $DBMS_HOME/scripts/mysql.server start
  • Then, you need to set the password for the root user. For this example, we are going to set the password to 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'
  • Start a MySQL client with:
    $DBMS_HOME/mysql/bin/mysql \
    --defaults-file=$DBMS_HOME/scripts/my.cnf -u root -p
    and enter the root password.
  • Typing '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

  • If you have made it this far, you are in good shape. Note: If you installed using RPMs on Linux, you don't need to do this step. It is already done. Kill the test server and add MySQL to the startup for the machine (the following lines are for Solaris. Modify appropriately for your system. If you are running on an older version of Redhat, you might not have an /etc/init.d directory. Instead, you can use the /etc/rc.d/init.d directory):
    $DBMS_HOME/scripts/mysql.server stop
    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 S95mysqlLocal
    and restart the server with:
    /etc/init.d/mysql.biocore_local_server start

    Next Step: Adding the BioCoRE database.
    Back to the installation page


    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.