Mysql – Is the MySQL instance irretrievably dead

MySQL

I'm trying to install a JIRA instance on a MySQL 5.1.73 instance running on CentOS 6.5 for our developers.

The install gets to the point where I need to create the database, and then FLUSH PRIVILEGES;

This is what I get:

ERROR 1033 (HY000): Incorrect information in file: './mysql/tables_priv.frm'

So I hit google, and try what's suggested by those who know.

(root@root.server) [mysql] 18:19:47 (4) $ REPAIR TABLE tables_priv EXTENDED USE_FRM ;
+-------------------+--------+----------+---------------------------------------------    -------------+
| Table             | Op     | Msg_type | Msg_text                                                     |
+-------------------+--------+----------+---------------------------------------------    -------------+
| mysql.tables_priv | repair | Error    | Incorrect information in file:     './mysql/tables_priv.frm' |
| mysql.tables_priv | repair | error    | Corrupt                                                      | 
+-------------------+--------+----------+---------------------------------------------    -------------+
2 rows in set (0.00 sec)

After trying some other stuff, I decide to cut my losses, and reinstall the database..

mysqldump --events --lock-all-tables --all-databases -u root -p*********** > alldatabases.23.07.2014.sql

Oops…

mysqldump: Couldn't execute 'show events': Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577)

All right, so I'm stuck, now. The 'nuclear option' would be to remove the database files, uninstall the database and reinstall it, but we have Groupware (Horde) running on that server, and that would be .. not cool.

Any help gratefully received.

Best Answer

Looks like you installed MySQL 5.1 over a 5.0 (or older) installation, without running mysql_upgrade to create new system tables and add columns to existing system tables. – Bill Karwin 25 mins ago

It is safe to run mysql_upgrade without disturbing your other databases.

Read http://dev.mysql.com/doc/refman/5.1/en/mysql-upgrade.html for more information