mysql主从错误1007_mysql主从配置的三个错误及解决方法(图文)

mysql数据库主从配置的重点在于:

主锁表——主查指针——导数据——从写入指针——从开启进程,这样一个过程。

本文把自己遇到的三个错误分享一下,并给出具体的解决方法。

问题1、innodb引擎使用了FLUSH TABLES WITH READ LOCK 之后,再用mysqldump导出数据失败,停在那里导不出来。

解决办法:

my.cnf没有对innodb引擎做优化,然后加入以下配置:

1405523548_2138.jpg

然后,重启mysql,问题解决。

好习惯:修改my.cnf之前,务必对数据库作一次全备份,以免数据丢失,带来无尽的烦恼。

问题2、从数据库启动slave进程后出现错误:

120116 13:20:13 [ERROR] Slave: According to the master's version ('5.0.30-log'), it is probable that master suffers from this bug: http://bugs.mysql.com/bug.php?id=24432 and thus replicating the current binary log event may make the slave's data become different from the master's data. To take no risk, slave refuses to replicate this event and stops. We recommend that all updates be stopped on the master and slave, that the data of both be manually synchronized, that master's binary logs be deleted, that master be upgraded to a version at least equal to '5.0.38'. Then replication can be restarted. Error_code: 1105

原因大于:主数据库的版本太低。

解决办法:

升级 主数据库版本 或 降低从数据库版本。

尽可能地保证主从数据库的版本一致。

问题3、启动slave进程后出现1062错误,

原因:数据冲突错误

解决办法:

1)、可以先找出来重复的数据,然后删掉。

2)、也可以在my.cnf中加入slave-skip-errors=126,1062 跳过此错误,不知道这个方法好不好。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值