[mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /usr/local/mysql/bin/mysqladmin user = mysql (用一个帐号来启动所有的mysql服务器,因为是用一相同的帐号。那个么这帐号必须都是每个mysql服务都要用的帐号,最好是管理帐号,下面的口令与相同) password = mypaswd
[mysqld1] port = 3306 socket = /tmp/mysql.sock1 pid-file=/usr/local/mysql/data1/db-app1.pid log=/usr/local/mysql/data1/db-app.log datadir = /usr/local/mysql/data user = mysql
[mysqld2] port = 3307 socket = /tmp/mysql.sock2 pid-file = /usr/local/mysql/data2/db-app2.pid datadir = /usr/local/mysql/data2 log=/usr/local/mysql/data2/db-app.log user = mysql
[mysqld3] port = 3308 socket = /tmp/mysql.sock3 pid-file = /usr/local/mysql/data3/db-app3.pid3 datadir = /usr/local/mysql/data3 log=/usr/local/mysql/data3/db-app.log user = mysql
[mysqld4] port = 3309 socket = /tmp/mysql.sock4 pid-file = /usr/local/mysql/data3/db-app4.pid datadir = /usr/local/mysql/data4 log=/usr/local/mysql/data4/db-app.log user = mysql
我们可能看看这些目录是否都存在. db-app:/ # ls -l /usr/local/mysql/
drwxr-xr-x 6 mysql mysql 4096 Apr 9 17:54 data4 drwxr-x--- 2 mysql mysql 4096 Apr 9 17:14 data1 drwxr-xr-x 3 mysql mysql 4096 Apr 9 17:54 data2 drwxr-xr-x 3 mysql mysql 4096 Apr 9 17:54 data3
五,未来测试, 接下来我想做一个多主一从的Mysql服务器复制解决方案! 那位可以给点意见啊!结构如下. 就是有主服务器Server A , Server B和从服务器 Server C, A 和 B运行着不同的数据库应用, 假设数据库名都不同。Server C(假设这三台PC上都只运行了一个mysql服务),包括了A了B服务器的所有Mysql 用户及相同的访问权限, 并集成在一个Mysql服务中. C通过主/从方式复制A和B的数据库。