Showing posts with label automysqlbackup. Show all posts
Showing posts with label automysqlbackup. Show all posts

Wednesday, May 1, 2013

Solve AutoMySQLBackup warning mysql.event

Fix for: -- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.

edit /usr/sbin/automysqlbackup (wherever your /etc/cron.daily/automysqlbackup points)
find the OPT="--quote-names" line (about line 354)

Change it to
OPT="--quote-names --events --ignore-table=mysql.event"

OR, (Based upon additional reading of responses):
one of:
OPT="--quote-names --events"

OPT="--quote-names --ignore-table=mysql.event"

The original line suppresses the warning and ignores the table (redundant).
If you wish to have the table in your backup, don't ignore the table, just use --events
If you don't care about the table, ignoring the table will also suppress the event message.

What's optimal? Depends on if you use events and require them to be restored.
http://dev.mysql.com/doc/refman/5.1/en/events-table.html



Reference: http://bugs.mysql.com/bug.php?id=68376

Saturday, February 23, 2013

automysqlbackup error fix

You get this:
mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'debian-sys-maint'@'localhost' for table 'cond_instances' when using LOCK TABLES

to fix it:
edit /etc/default/automysqlbackup
change the DNAMES line to this:



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 ,\ `
or, to be succinct: add
 | grep -v ^performance_schema$ 
into the list. If you're doing any different method of DBNAMES, just make sure to exclude performance_schema.

Why is this happening?
automysqlbackup's default configuration attempts to lock tables before dumping. This error isn't specifically automysqlbackup's problem to fix, as much as it's a problem (or not) that performance_schema.cond_instances can't be locked [by debian-sys-maint] at the time of mysqldump, and mysqldump is what's throwing the error.

Is it a problem of backing up or not backing up performance_schema?
I can't answer that for your situation, though if you understand what the table does and how to recreate it you can be better informed about whether the backup is necessary to you. (hint: probably not unless corporately you need to keep all diagnostic logs on everything.) Also, this is not related to the other databases which actually hold your data and which you do want to back up.
 What does grep -v do?
It says, "don't include this in the list". Note, while you're here, that this also includes the "mysql" table. If you need to keep your users and permissions for disaster recovery reasons, you may wish to consider not excluding that table.
What is "Database"? Why is that grep -v? I don't have a database called Database.
Database is the column title of the result of "SHOW DATABASES" SQL query.

Blog Archive