标签:lin 账号 lse tabs show cat first mys size
create user ‘sync‘@‘192.168.10.%‘ identified by ‘sync‘; grant replication slave on *.* to ‘sync‘@‘192.168.10.%‘; flush privileges;
# /etc/my.cnf增加一下配置 # open binary log mode log_bin = /mydata/binlog binlog-format = ROW
mysqldump --single-transaction -uroot -hmaster -P3308 --master-data=2 -A |mysql -uroot -hslave -P3308
mysql -uroot -hmaster -P3308 -e " CHANGE MASTER TO MASTER_HOST=‘192.168.10.181‘, MASTER_USER=‘sync‘, MASTER_PASSWORD=‘sync‘, MASTER_PORT=3306; "
-- 开启主从 start slave;
show slave status\G; show master status\G;
标签:lin 账号 lse tabs show cat first mys size
原文地址:https://www.cnblogs.com/binliubiao/p/12523527.html