In the test MySQL multi-master one from the server, that is, a multi-port synchronization from the server to different main libraries. This document records the operation of opening different ports.
Detailed steps:
1 , first of all, the my.cnf configuration file is copied a copy, open a few ports to copy several of course to rename .
Such as:
Cp/usr/local/mysql/my.cnf/usr/local/mysql/my3307.cnf
Cp/usr/local/mysql/my.cnf/usr/local/mysql/my3308.cnf
Cp/usr/local/mysql/my.cnf/usr/local/mysql/my3309.cnf
2 my3306.cnf my3307.cnf my3308.cnf 3306 Port changed to &NBSP, 3307 3308 3309.
Such as:
[Client]
Port = 3308
Socket =/tmp/mysql3308.sock
Default-character-set=utf
[Mysqld]
Port = 3308
Socket =/tmp/mysql3308.sock
Basedir =/usr/local/mysql
DataDir =/www/mysqldata8
3. Initializing the database
/usr/local/mysql/scripts/mysql_install_db--datadir=/usr/local/mysql/mysqldata3306/--user=mysql--basedir=/usr/ Local/mysql
/usr/local/mysql/scripts/mysql_install_db--datadir=/usr/local/mysql/mysqldata3307/--user=mysql--basedir=/usr/ Local/mysql
/usr/local/mysql/scripts/mysql_install_db--datadir=/usr/local/mysql/mysqldata3308/--user=mysql--basedir=/usr/ Local/mysql
4. to start mysql, specify . CNF file and Directory startup
/usr/local/mysql/bin/mysqld_safe--defaults-extra-file=/usr/local/mysql/my3307.cnf--datadir=/usr/local/mysql/ data/mysqldata3307--user=mysql &
/usr/local/mysql/bin/mysqld_safe--defaults-extra-file=/usr/local/mysql/my3308.cnf--datadir=/usr/local/mysql/ data/mysqldata3308--user=mysql &
/usr/local/mysql/bin/mysqld_safe--defaults-extra-file=/usr/local/mysql/my3309.cnf--datadir=/usr/local/mysql/ data/mysqldata3309--user=mysql &
5. Stop MYSQL, corresponding to the sock file.
/usr/local/mysql/bin/mysqladmin-uroot-s/tmp/mysql3308.sock shutdown
6. Login MySQL
Mysql-s/tmp/mysq3308.sock-p 3308
Ps:
I'm not sure about whether the Mysql.sock file is using the same file or using the original file for linking. My method is to link the Mysql.sock file.
Ln-sf/tmp/mysql.sock/tmp/mysql3307.sock
This article is from the "sonw" blog, make sure to keep this source http://snow1988.blog.51cto.com/6351351/1765060
MySQL Multi-instance configuration