Crash Mysql -> Recovery

Ca n’a pas loupé, le dernier post au sujet de la sauvegarde de MySQL est plus que d’actualité.

En effet, hier, suite à une maj de mysql-server:

 # portupgrade mysql-server

MySQL était alors plantée avec le message suivant:

110817 21:02:23 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
110817 21:02:23 InnoDB: The InnoDB memory heap is disabled
110817 21:02:23 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110817 21:02:23 InnoDB: Compressed tables use zlib 1.2.3
110817 21:02:23 InnoDB: Initializing buffer pool, size = 256.0M
110817 21:02:23 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 67108864 bytes!
110817 21:02:23 [ERROR] Plugin 'InnoDB' init function returned error.
110817 21:02:23 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110817 21:02:23 [ERROR] Unknown/unsupported storage engine: InnoDB
110817 21:02:23 [ERROR] Aborting

110817 21:02:23 [Note] /usr/local/libexec/mysqld: Shutdown complete

110817 21:02:23 mysqld_safe mysqld from pid file /var/db/mysql/tripaxland4thot.pid ended

Etant donné que le service est en production et que les bases sont relativement petites, la restauration fut immédiate:

# rm -rf /var/db/mysql/*
# ls -la /root/_archives/mysql/db.all.201108*
-rw-r--r--  1 root  wheel  3627458 Aug 15 01:01 /root/_archives/mysql/db.all.20110815.sql.gz
-rw-r--r--  1 root  wheel  3639055 Aug 16 01:01 /root/_archives/mysql/db.all.20110816.sql.gz
-rw-r--r--  1 root  wheel  3651217 Aug 17 01:01 /root/_archives/mysql/db.all.20110817.sql.gz
# zcat /root/_archives/mysql/db.all.20110817.sql.gz | mysql
# /usr/local/etc/rc.d/mysql start

Et tout refonctionne 🙂