Add the mysql user and group
groupadd mysql
useradd -g mysql mysql
useradd -g mysql mysql
Untar and Create a symbolic link
cd /usr/local/
tar -zxvf mysql-{version}.tar.gz
ln -s mysql-{version} mysql
tar -zxvf mysql-{version}.tar.gz
ln -s mysql-{version} mysql
File and Directory creation/permissions
mkdir -p /var/lib/mysql *
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /var/lib/mysql
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /var/lib/mysql
Install the system databases and place my.cnf
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf**
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql***
scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql --basedir=/usr/local/mysql ****cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql***
Start mysqld
/usr/local/mysql/bin/mysqld_safe &
Check your error log file to keep abreast of any issues that might arise.
Some house keeping is needed to ensure that MySQL will start a boot and also adding mysql into the path. These are basic Linux tasks. Please let me know if you'd like to see my recommendations for these tasks.
* This command is going to create your datadir location. This might not fit your preferences so this is something that you will choose to include or omit. You should review your my.cnf and make any changes to accommodate your desired location.
** This will copy a default my.cnf to the preferred my.cnf location. If you have written your own or have something you wish to use, copy that and not the example file. Your my.cnf is a pretty big deal as it's going configure your server to run like a two-legged dog or Usain Bolt!
*** Enables the 'service mysql [start|stop|status]' command to be executed
**** These parameters can be augmented, omitted or kept. You're going to want to use the values in your my.cnf or change your my.cnf to reflect what you use here.
