AutoMySQLBackup備份時,出現mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES錯誤,具體內容如下所示
[root@DB-Server ~]# /usr/bin/automysqlbackup /etc/automysqlbackup/myserver.conf
Parsed config file "/etc/automysqlbackup/automysqlbackup.conf"
# Checking for permissions to write to folders:
base folder /u03 ... exists ... ok.
backup folder /u03/mysqlbackup/ ... exists ... writable? yes. Proceeding.
checking directory "/u03/mysqlbackup//daily" ... exists.
checking directory "/u03/mysqlbackup//weekly" ... exists.
checking directory "/u03/mysqlbackup//monthly" ... exists.
checking directory "/u03/mysqlbackup//latest" ... exists.
checking directory "/u03/mysqlbackup//tmp" ... exists.
checking directory "/u03/mysqlbackup//fullschema" ... exists.
checking directory "/u03/mysqlbackup//status" ... exists.
# Testing for installed programs
WARNING: Turning off multicore support, since pigz isn't there.
mysql ... found.
mysqldump ... found.
# Parsing databases ... done.
======================================================================
AutoMySQLBackup version 3.0
http://sourceforge.net/projects/automysqlbackup/
Backup of Database Server - localhost
Databases - mysql,performance_schema,test
Databases (monthly) - mysql,performance_schema,test
======================================================================
======================================================================
Dump full schema.
Rotating 4 month backups for
======================================================================
======================================================================
Dump status.
Rotating 4 month backups for
======================================================================
Backup Start Time Sat Jul 11 22:12:31 CST 2015
======================================================================
Daily Backup ...
Daily Backup of Database ( mysql )
Rotating 6 day backups for mysql
----------------------------------------------------------------------
Daily Backup of Database ( performance_schema )
Rotating 6 day backups for performance_schema
----------------------------------------------------------------------
Daily Backup of Database ( test )
Rotating 6 day backups for test
----------------------------------------------------------------------
Backup End Time Sat Jul 11 22:12:31 CST 2015
======================================================================
Total disk space used for backup storage...
Size - Location
443k /u03/mysqlbackup/
======================================================================
###### WARNING ######
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES
Warning: Using a password on the command line interface can be insecure.
du: WARNING: use --si, not -H; the meaning of the -H option will soon
change to be the same as that of --dereference-args (-D)
要解決這個錯誤只需要修改MySQLBackup的配置文件,將參數CONFIG_mysql_dump_single_transaction設為'yes'即可解決問題。網上關於這個錯誤的解決方法也有設置--skip-lock-tables的