mysql在window机器下的双机备份

来源:互联网 发布:朝鲜没有网络吗 编辑:程序博客网 时间:2024/05/29 11:53

参考网站:

http://www.cnblogs.com/sshoub/p/4392688.html

http://www.cnblogs.com/sshoub/p/4392688.html


只是个人见解,望大神指教

  1)数据库版本要高于5.1

  2)从数据库的版本要 >= 主数据库服务器的版本

  3)数据库操作所用工具为 :Navicat for MySQL

  4)主数据库IP:192.168.3.16

      从数据库IP:192.168.3.74

具体设置可以看文章 http://www.cnblogs.com/sshoub/p/4392688.html


这里主要针对出现的问题进行讲解

自己发现如果主服务器发送错误命令给从服务器 从服务器就会自动不在进行一系列的操作

所以在从服务器的配置文件里面加上

#slave-skip-errors=1062,1053,1146 #跳过指定error no类型的错误
#slave-skip-errors=all #跳过所有错误 (本人使用)


另外自己贴一下重要配置信息:

master:

server_id = 16
log_bin=mysql-bin
binlog-do-db =testliujia
log_bin_trust_function_creators=TRUE


slave:

server_id = 74
slave-skip-errors=all


重要命令:

grant replication slave on *.* to 'tantuls'@'%' identified by 'world'; 
change master to   master_host='192.168.3.16',  master_user='tantuls',  master_password='world',  (自己实际情况)master_log_file='mysql-log.000001',  (自己实际情况)master_log_pos=1234; (自己实际情况)

show master status;
start slave;
stop slave;
show slave status;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1
show slave status \G;(这个我用不了 不知道为啥)







原创粉丝点击