1. Create a data file
mkdir /var/lib/mysql_3307 --datadir=/var/lib/mysql_3307--user=mysql
2. Give the data file to MySQL user and user group
chown -R mysql.mysql/var/lib/mysql_3307
3. Copy the configuration file
CP /ETC/MY.CNF/ETC/MY_3307.CNF
4. Modify the configuration file
[client] #password = your_password port 3307 socket =/var/lib/mysql_3307/mysql_3307.sock for Some specific programs # The MySQL server [mysqld] port 3307 socket =/var/lib/mysql_ 3307/mysql_3307.sock datadir=/var/lib/mysql_3307
5. Start MySQL
/usr/bin/mysqld_safe--defaults-file=/etc/my_3307.cnf &
6. Check whether the start is successful
[[Email protected]206 ~]# netstat-ntlp TCP 0 0 :::3306 :::* LISTEN 3919/mysqld tcp 0 0 :::3307 :::* LISTEN 15027/mysqld
If you do not find the port number you want MySQL instance, you can check the next/var/lib/mysql_3307/3307. log file, troubleshoot the problem
MYSQL Multi-instance run