Yesterday, I was testing various backup and recovery methods supported by ZRM for MySQL before 1.1.1 release. ZRM for MySQL requires binary logging to be enabled on the MySQL server. I ran out of disk space during testing and removed the binary logs. Accidently, I deleted the last binary log used by MySQL server. MySQL server uses the most recent binary log.
I could not start MySQL server again.
# service mysqld start
061031 17:38:48 mysqld started 061031 17:38:48 InnoDB: Started; log sequence number 14 1645228884 /usr/libexec/mysqld: File '/var/lib/mysql/mysql-bin.000017' not found (Errcode: 2) 061031 17:38:48 [ERROR] Failed to open log (file '/var/lib/mysql/mysql-bin.000017', errno 2) 061031 17:38:48 [ERROR] Could not open log file 061031 17:38:48 [ERROR] Can't init tc log 061031 17:38:48 [ERROR] Aborting
061031 17:38:48 InnoDB: Starting shutdown...
061031 17:38:51 InnoDB: Shutdown completed; log sequence number 14 1645228884 061031 17:38:51 [Note] /usr/libexec/mysqld: Shutdown complete 061031 17:38:51 mysqld ended
Thanks to Sheeri Kritzer for giving me ideas on how to resolve the problem. The binary log index file ( /var/lib/mysql/mysql-bin.index) stores information about most recent binary log file. Deleting the index file solves the problem. Of course, I had backups of the database using ZRM for MySQL and I could recovery to any point in time before the binary log deletion.
Bottomline: Do not delete the most recent binary log file to save disk space and do regular backups.