Friday, December 7, 2007

Help! My Database Stopped Working

What do you do when MySQL stopped working? Here are my 2 cents on what you should do.

  1. Check if the database is running. Check the MySQL process.

    ps -aux | grep mysql

  2. Check the error logs. Where is the location of the error logs again? The default location would be at /usr/local/mysql/data/ and look for a file with .err at the end of it. Sample errors would be:

    • Database got restarted - check with your sys admin why it restarted.
    • Replication failed - do a show slave status and check the error then restart the replication.

  3. Check the MySQL process list and see if there are any read / write locking happening.

    show processlist

No comments: