复制代码 代码如下:
INSERT INTO user (Host,User, Password,Select_priv,Insert_priv,Update_priv,Delete_priv, Create_priv,Drop_priv) VALUES('%','test',password('test'),'Y','Y','Y','Y','Y','Y');
复制代码 代码如下:
FLUSH PRIVILEGES;
复制代码 代码如下:
server-id = 1
replicate-do-db=test
replicate-do-db=test_admin
log-bin=mysql-bin
log-slave-updates
replicate-wild-do-table=test.%
replicate-wild-do-table=test_admin.%
binlog-ignore-db=mysql
slave-skip-errors=all
复制代码 代码如下:
server-id = 3
binlog-do-db=test
binlog-do-db=test_admin
log-bin=mysql-bin
log-slave-updates
replicate-wild-do-table=test.%
replicate-wild-do-table=test_admin.%
binlog-ignore-db=mysql
slave-skip-errors=all
复制代码 代码如下:
slave stop;
复制代码 代码如下:
reset master;
复制代码 代码如下:
GRANT REPLICATION SLAVE ON *.* TO 'test'@'%' IDENTIFIED BY 'test';
复制代码 代码如下:
flush privileges;
复制代码 代码如下:
flush tables with read lock;
复制代码 代码如下:
slave stop;
复制代码 代码如下:
CHANGE MASTER TO MASTER_HOST='10.1.10.28', MASTER_USER='test', MASTER_PASSWORD='test', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;
复制代码 代码如下:
slave stop;
复制代码 代码如下:
reset master;
复制代码 代码如下:
GRANT REPLICATION SLAVE ON *.* TO 'test'@'%' IDENTIFIED BY 'test';
复制代码 代码如下:
flush privileges;
复制代码 代码如下:
flush tables with read lock;
复制代码 代码如下:
slave stop;
复制代码 代码如下:
CHANGE MASTER TO MASTER_HOST='10.1.10.30', MASTER_USER='test', MASTER_PASSWORD='test', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;
复制代码 代码如下:
server-id = 2
replicate-do-db=test
replicate-do-db=test_admin
log-bin=mysql-bin
log-slave-updates
replicate-wild-do-table=test.%
replicate-wild-do-table=test_admin.%
binlog-ignore-db=mysql
slave-skip-errors=all
复制代码 代码如下:
slave stop;
复制代码 代码如下:
CHANGE MASTER TO MASTER_HOST='10.1.10.28', MASTER_USER='test', MASTER_PASSWORD='test', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;
复制代码 代码如下:
slave start;
复制代码 代码如下:
server-id = 4
replicate-do-db=test
replicate-do-db=test_admin
log-bin=mysql-bin
log-slave-updates
replicate-wild-do-table=test.%
replicate-wild-do-table=test_admin.%
binlog-ignore-db=mysql
slave-skip-errors=all
复制代码 代码如下:
slave stop;
复制代码 代码如下:
CHANGE MASTER TO MASTER_HOST='10.1.10.30', MASTER_USER='test', MASTER_PASSWORD='test', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=107;
复制代码 代码如下:
slave start;
新闻热点
疑难解答