mysqldump: Got error: 1556: You can't use locks with log tables. when using LOCK TABLES

Posted moss_tan_jun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysqldump: Got error: 1556: You can't use locks with log tables. when using LOCK TABLES相关的知识,希望对你有一定的参考价值。

mysqldump: Got error: 1556: You can‘t use locks with log tables. when using LOCK TABLES

我是把一些mysqldump语句放在一个批量命令文件(传说中的.sh文件)中执行的,而当我把这些
mysqldump语句分离开来一个一个执行的时候,我发现是没有任何错误的,于是在网络上找了一些资料:
发现是mysql默认数据库里的logs表,不能被加锁(lock tables)引起的。
于是我测试了一下,把关于mysql这个默认数据库相关的语句清空后,整个文件即可正常运行。
还有一个解决方法:
便是在mysql这个数据库相关的那句mysqldump加上 --lock-tables=0 这个参数,不锁表备份,也是可行的。

以上是关于mysqldump: Got error: 1556: You can't use locks with log tables. when using LOCK TABLES的主要内容,如果未能解决你的问题,请参考以下文章

mysqldump: Got error: 1102: Incorrect database nam

mysqldump Got error 1045 Access denied for user 'roor' 'l

(转)mysqldump: Got error: 1556: You can't use locks with log tables.

mysqldump: Got error: 1044: Access denied for user 'backupuser'@'%' to database '

mysqldump: Got error: 1449: The user specified as a definer ('user'@'%') does not ex

mysqldump: Got error: 1556: You can't use locks with log tables. when using LOCK TABLES