Installing MySQL¶
Start by adding a user:
>groupadd mysql >useradd -g mysql mysql
Creation of folders:
>cd /usr/local >mkdir mysql >chown mysql mysql/ >chgrp mysql mysql/ >su - mysql >cd /usr/local/mysql >mkdir data tmp var
Then:
>tar -zxvf mysql-4.1.11.tar.gz >move mysql-4.1.11.tar.gz source >cd source >./configure --localstatedir=/usr/local/mysql/data --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
Compilation:
>make >make test (optional) >make install
Change folders right (just to be sure):
>chown -R mysql /usr/local/mysql >chgrp -R mysql /usr/local/mysql >chmod 700 /usr/local/mysql/data >chmod 700 /usr/local/mysql/var >chmod 755 /usr/local/mysql/tmp
Launch the mysql init script:
>scripts/mysql_install_db >chown -R mysql.mysql /usr/local/mysql
Check if evreything is all right:
>/usr/local/mysql/bin/mysqld_safe -user=mysql & >/usr/local/mysql/bin/mysqladmin -u root password <password> >/usr/local/mysql/bin/mysqladmin -p status >/usr/local/mysql/bin/mysqladmin -p shutdown
In order to launch mysql automatically there are various methods:¶
In the directory where MySQL is uncompressed:
Cp support-files/mysql.server /usr/local/sbin
Then modify /etc/rc .d/rc.local and add:
/usr/local/sbin/mysql.server start Chmod 744 /usr/local/sbin/mysql.server