GRANT REPLICATION SLAVE ON *.* TO backup@’192.168.1.108‘ IDENTIFIED BY ‘123456’;
主服务器(ubuntu):
[mysqld]
server-id = 1 #主机标示,整数
log-bin = /var/log/mysql/mysql-bin.log #确保此文件可写
read-only =0 #主机,读写都可以
binlog-do-db =testslave #需要备份数据,多个写多行
binlog-ignore-db =mysql #不需要备份的数据库,多个写多行
从服务器(centos):mysql5.5之后不再适用
[mysqld]
server-id=2
master-host=192.168.1.108
master-user=backup
master-password=123456
master-port=3306
master-connect-retry=60
log-bin=mysql-bin
replicate-do-db=testslave
replicate-ignore-db=mysql
阅读(1312) | 评论(0) | 转发(0) |