Mysqldump:got error:1556:you can ' t use the locks with log tables.
Original: http://blog.51cto.com/oldboy/1122867
MySQL master-Slave synchronization error Solved An example: This article from the old boy Linux operation and maintenance of the internal teaching Plan contents summary
FAQ: question 1:mysqldump:got error:1556:you can ' t use the locks with log tables.
In the old boy took the student master from the synchronous practice, found that the student practice operation encountered the following problems can not be solved, so the old boy to solve the process summarized as follows:
[[email protected] ~]# mysqldump-uroot-p ' Oldboy '-s/data/3306/mysql.sock-a-B >a.sql
Mysqldump:got error:1556:you can ' t use the locks with log tables. When using LOCK TABLES
Resolution process:
The same operation, the other 10 students are OK, only the student has a problem, after the inquiry, and review the relevant configuration process, contact to the previous period also have students have similar problems, so, found the cause.
[email protected] ~]# which mysqldump
/usr/bin/mysqldump
Find the reason, MySQL installation path for/application/mysql, view mysqldump path should be/application/mysql/bin only, but now the path is RPM package installed MySQL command path, this reason found.
[Email protected] ~]# tail-1/etc/profile
Export path= $PATH:/application/mysql/bin
In the/etc/profile file, the MySQL command path, the student put the end, so when the execution of the mysqldump command, the first to find the RPM package comes with the/usr/bin/mysqldump command, resulting in an error.
Let's put the MySQL command path to the front of the PATH variable:
[Email protected] ~]# tail-1/etc/profile
Export Path=/application/mysql/bin: $PATH
[Email protected] ~]#. /etc/profile
[Email protected] ~]# 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
[email protected] ~]# which mysqldump
/application/mysql/bin/mysqldump
At this point in the export database:
[[Email protected] ~] #mysqldump-uroot-p ' Oldboy '-s/data/3306/mysql.sock-a-B >a.sql
It can be exported normally.
Below the classmate search, other users of the same error in another article:
mysqldump You can ' t use locks with log tables 11-01-13 11:05:02
Http://blog.chinaunix.net/uid-21757535-id-86425.html
Category: mysql/postgresql
When I was doing a database backup recently, I encountered an error like this:
Mysqldump:got error:1556:you can ' t use the locks with log tables. When using LOCK TABLES
I put some mysqldump statements in a batch command file (the legendary. sh file) executed, and when I put these
Mysqldump statement separate from one execution, I found that there was no error, so I looked up some information on the Web:
Discovery is the logs table in the MySQL default database and cannot be caused by locking (lock tables).
So I tested and emptied the statement about MySQL, the default database, and the entire file worked.
There is also a workaround:
Is in MySQL this database related to the sentence mysqldump plus--lock-tables=0 This parameter, do not lock the table backup, is also feasible.
(EXT) Mysqldump:got error:1556:you can ' t use the locks with log tables.