MySQL Installation
1. Download MySQL to/usr/local/src/
cd/usr/local/src/
wget + Links
2. Decompression
Tar zxvf/usr/local/src/mysql-
3, the extracted data moved to/usr/local/mysql
MV mysql-/usr/local/mysql
4. Establish a database
Useradd-s/sbin/nologin MySQL
5. Initialize the database
#cd/usr/local/mysql
#mkdir-P/data/mysql; Chow-r Mysql:mysql/data/mysql
#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
6. Copy the configuration file
#cp suport-files/my-large.cnf/etc/my.cnf
7. Copy the startup script file and modify its properties
#cp Support-files/mysql.server/etc/init.d/mysql
#chmod 755/etc/init.d/mysql
8. Modify the startup script
#vim/etc/init.d/mysqld
Modify the directory defined when the data is initialized prior to "Datadir=/data/mysql"
9. Add the startup script to the system service item and set the boot to start MySQL
#chkconfig--add mysqld
#chkconfig mysqld on
#service mysqld Start
If it doesn't start. Please check the error log under/data/mysql/, which is usually the hostname. Err. Check whether MySQL startup command is:
#ps aux |grep mysqld
MySQL Installation tutorial