Here is a fix if for the automysqlbackup error message* mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user ‘debian-sys-maint’@’localhost’ for table ‘cond_instances’ when using LOCK TABLES*

The simple fix is to edit the file /etc/default/automysqlbackup and change

DBNAMES=mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | tr \\\r\\\n ,\

to

DBNAMES=mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | tr \\\r\\\n ,\

This excludes the performance_schema database from being backuped and causing this error. Unfortunately you cannot just add performance_schema to DBEXCLUDE as the DBEXCLUDE line does not work in the current Debian / Ubuntu version (not sure if it is a AutoMySQLBackup bug or if it happens because DBNAMES is not set to “all”).