Building/running MySQL on your AFS space

Building/running MySQL on your AFS space

This page utilizes tools which are only available for versions < 6 of MySQL. For newer versions, see Mysql

1) Obtain MySQL source code from:

   ==> at "Select Platform", choose "Source Code" and then download "Generic Linux (Architecture Independent), Compressed TAR Archive" at the bottom.
   ==> at the download page select "No thanks, just start my download." 

2) tar -zxvf mysql-X.Y.Z.tar.gz

3) module load cmake

4) Create MySQL installation directory and its subdirectrories:

  mkdir $HOME/MySQL
  mkdir $HOME/MySQL/data
  mkdir $HOME/MySQL/etc
  mkdir $HOME/MySQL/tmp
  mkdir $HOME/boost


  mkdir /tmp/$USER  (==> For example, /tmp/crcuser will be created)

5) cd mysql-X.Y.Z

6) Configure/install MySQL with some options. Installation should take approximately 35-40 minutes:

  -DMYSQL_UNIX_ADDR=/tmp/$USER/mysql.sock .
  make install

7) Prepare/create base MySQL database tables:

   setenv PATH $HOME/MySQL/bin:$HOME/MySQL/scripts:$PATH

   mysql_install_db --basedir=$HOME/MySQL --datadir=$HOME/MySQL/data --tmpdir=$HOME/MySQL/tmp --user=$USER

==> This will create "my.cnf" in the base directory ($HOME/MySQL). If not, copy it from $HOME/MySQL/support-files:

  cp $HOME/MySQL/support-files/my-default.cnf $HOME/MySQL/my.cnf

8) Edit the my.cnf file and add below lines, for example:

   basedir = /afs/
   datadir = /afs/
   socket = /tmp/crcuser/mysql.sock 

==> Attention !!!!

*** The full path name should be added explicitly.

9) Start/stop the MySQL server - Download script file

    i)  Download this file and move into $HOME/MySQL/scripts/ directory and unzip the zip file


   ii) Execute the command: 
  setenv PATH $HOME/MySQL/bin:$HOME/MySQL/scripts:$PATH

   ii) To start/stop the MySQL server:

            crc-mysql.server start
            crc-mysql.server stop

10) To load the MySQL client:

  mysql> help
  mysql> show databases ;