1.用户相关

  • 双机同步用户创建
grant replication slave on *.* to sync@'172.21.210.214' identified by '123456';
  • 管理用户创建
GRANT ALL privileges ON *.* TO 'airdreams'@'%' IDENTIFIED BY 'ucheck' WITH GRANT OPTION; 
  • 刷新权限
flush privileges;

2.同步相关

  • 设置从机向master主机同步
change master to master_host='172.21.100.162',master_user='airdreams',master_password='123456',master_port=3306,master_log_file='binlog.000001',master_log_pos=1;
  • 通过时间查看bin日志信息
mysqlbinlog --start-datetime="2010-11-20 00:00:00"  --stop-datetime="2010-11-21 00:00:00"  mysql-bin.000141

发表评论