26 April 2013

MySQL Innodb disaster recovery

After crash, disk failure ... some MySQL part can be broken.
According to the corruption, there is some solution to recover data.

Instructions:

  • stop server (if it is still running)
  • backup existing meta-data (usually in /usr/lib/mysql)
  • update server configuration (/etc/mysql/my.cnf), adding following line under [mysqld]

innodb_force_recovery = 4

  • launch this command (WARNING: you will lose some MySQL Meta-data, like permissions, but NO data)

mysql_install_db

You can then start MySQL server, ever with service or manually:
/usr/bin/mysqld_safe

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: