Mysql 主从配置

[mysqld]
#主从
log-bin=mysql-bin-master
server-id=1
binlog-do-db=zn
binlog-ignore-db=mysql

 

[mysqld]
super_read_only=on
server-id=2
slave-skip-errors=1007,1051,1062


相关SQL

 

导出SQL

mysqldump -uroot -p123456 mysql > /tmp/mysql.sql

导入SQL

mysql -uroot -p123456 aming < /tmp/mysql.sql

 

创建同步user

grant replication slave on *.* to slave@'%' identified by "123";

 

开启slave

change master to master_host='192.168.210.132',master_user='slave',master_password='123';

你可能感兴趣的:(中间件部署)