mysql主从同步出现错误解决一例:本文出自老男孩linux运维实战培训内部教案内容整理总结
在老男孩带学生做主从同步实践时,发现学生实践操作时遇到如下问题无法解决,于是,老男孩把解决的过程总结如下:
[root@Oldboy ~]# mysqldump -uroot -p'oldboy' -S /data/3306/mysql.sock -A -B >a.sql
mysqldump: Got error: 1556: You can't use locks with log tables. when using LOCK TABLES
解决过程:
[root@Oldboy ~]# which mysqldump
/usr/bin/mysqldump
[root@oldboy ~]# tail -1 /etc/profile
export PATH=$PATH:/application/mysql/bin
[root@oldboy ~]# tail -1 /etc/profile
export PATH=/application/mysql/bin:$PATH
[root@Oldboy ~]# . /etc/profile
[root@Oldboy ~]# echo $PATH
/application/mysql/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/mysql/bin:/root/bin:/usr/local/mysql/bin:/application/mysql5.1.65/bin:/application/apache/bin
[root@Oldboy ~]# which mysqldump
/application/mysql/bin/mysqldump
此时在导出数据库:
[root@Oldboy ~]#mysqldump -uroot -p'oldboy' -S /data/3306/mysql.sock -A -B >a.sql
可以正常导出了。
--转自