The article explain how to install Mysql on a linux server.
- With root user, create a user mysql with an home directory in /opt/mysql :
- useradd -d /opt/mysql mysql
- With the mysql user install the last stable version of apache (exemple 5.1.35).
- su - mysql
- tar xzvf mysql-5.1.35-linux-i686-glibc23.tar.gz
- mv mysql-5.1.35-linux-i686-glibc23 v5135
- ln -s v5135 current
- Copy your my.cnf file in /etc directory with root user
- su - root
- cp /opt/mysql/current/support-files/my-medium.cnf /etc/my.cnf
- Edit my.cnf file and add the 4 lines after [mysqld] (datadir is the path to your data directory)
- # The MySQL server
- [mysqld]
- basedir = /opt/mysql/current
- datadir = /data/db
- default-storage-engine=InnoDB
- user=mysql
- In the mysql .bash_profile file update the path with $HOME/current/bin
- PATH=$PATH:$HOME/current/bin
- export PATH
- Automatic start and stop for Linux Redhat. With root copy mysql.server script in init.d directory.
- su -
- cp/opt/mysql/current/support-files/mysql.server /etc/rc.d/init.d/mysql
- chkconfig --add mysql
- Install DB
- su - mysql
- cd current
- ./scripts/mysql_install_db --user=mysql --basedir=/opt/mysql/current --datadir=/data/db
- Start and secure mysql
- su -
- service mysql start
- su - mysql
- cd current/bin
- ./mysql_secure_installation





