Theresa Arzadon-Labajo

Error 1556: You can't use locks with log tables

Posted by Theresa Arzadon-Labajo (tarzadon) on Jan 27 2014
Tech Stuff >> Unix-Linux
After upgrading MySQL to 5.1.71, automysqlbackup now gives the error "1556: You can't use locks with log tables. when using LOCK TABLES"

The error occurs because of the mysql.general_log and mysql.slow_log tables. One can exclude these tables in the configuration file, with:
CONFIG_table_exclude=( 'mysql.general_log' 'mysql.slow_log')
or exclude the whole database with:
CONFIG_db_exclude=( 'mysql' )

However, the script was still reporting the error. This is due to the full schema backup which specifically defines '--all-databases' in the automysqlbackup script:
opt_fullschema=( '--all-databases' '--routines' '--no-data' )

Add the '--lock-tables=0' option and the error will no longer appear.
opt_fullschema=( '--all-databases' '--routines' '--no-data' '--lock-tables=0' )

It probably would be better if automysqlbackup would exclude the mysql database or log tables instead.

Last changed: Feb 27 2020 at 4:03 PM

Back