MySQL crash

A very odd thing happened this morning. I got to experience my first real MySQL crash.

Apparently the MySQL server hadn’t been properly upgraded then I updated to the latest ubuntu release so it was in some kind of limbo state outside of the package management system. Doing a dpkg -l didn’t list it as being installed even though it was running. Quite odd indeed. But now I’ve got the latest version installed and all should be good again.

The scary thing was that the crash actually ruined a table. Any query to that table caused the connection to the MySQL server to be terminated. Luckily I implemented regular backups of all the databases a while ago, so it was easy to restore the last backup and I only lost a few hours of data.

This just emphasizes how important it is to have backups! Then you least expect it something breaks.