MySQL crash

Translation of the original in Catalan. Read it in: CatalàCastellano

For one day that it starts raining and I am at home working, quite a pleasure by the way. It has started to lightning and thunder until the power went out for about 2s in a lightning bolt that fell quite close and the worst thing is that the UPS has not had time to switch to the battery and my server has restarted. Something that would not be so serious either if it were not because I have lost almost 1h to be able to re-start MySQL... well in case something similar happens to someone here you have the symptoms and the remedy.

After looking at the log files of /var/log/mysql both mysql.err and mysql.log. I have not found anything that would indicate to me what the error was in fact, we could say that there was nothing talking about errors. So I have decided to move to the radical method and see what errors the system calls it made when launching the service gave:

strace -f -o mysql.trace /etc/init.d/mysql start

The only thing I have found is a small indicator that InnoDB was not starting well. Thanks to this clue I have reached the gentoo forums where I have found this post: MySQL doesn't start anymore after upgrade to 4.0.25 although the title is not very indicative of my problem, in a comment I have found the solution:

cd /var/lib/mysql
rm ib_logfile0
rm ib_logfile1
rm ibdata1

We launch the service again and everything solved, some log files that the storage of the MySQL engine uses had been corrupted and by deleting them they have been generated again. What suffering for so much silliness.

2 comments

Comments from the old blog, as they were written. Comments are closed.

  1. —

    El que et passava es que al my.cnf han canviat el valor de innodb_log_file_size de 8M a 5M, el propi ebuild ho diu quan actualitzes, la putada es q quan fas un emerge no llegeixes i després no pares el mysql hasta al cap de 4 anys i ja ni recordes que l'has actualitzat....

    The value of "innodb_log_file_size" into /etc/mysql/my.cnf file has changed size from "8M" to "5M".

    To start mysql either revert the value back to "8M" or backup and remove the old ib_logfile from the datadir

    Tindrien q posar-li una opció al emerge q fos algo aixi :P

    emerge -vu --make-me-hit-enter-when-an-important-message-is-shown mysql

  2. Carita