MySQL backup error


After upgrading my MySQL database server from version 5.0.95 to 5.1.61 I suddenly got these errors in the backup logging.

mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `EVENTS`': Cannot
proceed because system tables used by Event Scheduler were found damaged at server start
(1577)
dbdump gave errorcode 2 for database 'information_schema'
2012-08-09 09:07:53 -> Finished MySQL backup on host 'xxx.tonkersten.com'

Hmm, no idea what has happened. I hope I didn’t do something stupid.

Asking Google I found out that the information_schema tables where changed during the upgrade and that I could recreate the error with:

mysql> use information_schema
Database changed

mysql> SELECT /*!40001 SQL_NO_CACHE */ * FROM EVENTS;
ERROR 1577 (HY000): Cannot proceed because system tables used by Event Scheduler were found damaged at server start
mysql> Bye

So I tried to repair the error with:

mysql_upgrade -u root -h localhost -p --verbose

but still the same error.

Turns out that the MySQL server needs to be restarted for this to work.

Now I get

mysql> use information_schema
Database changed

mysql> SELECT /*!40001 SQL_NO_CACHE */ * FROM EVENTS;
Empty set (0.00 sec)
mysql> Bye
mysql  linux 

See also