One day you might wake up and find out that your blog displays a “database connection” error rather than your normal website. Often times, a simple restart of MySQL will fix the problem. Even if it is not that severe, you may start to see some database errors within WordPress itself. Most problems such as this relate to your WordPress database and can be fixed without much difficulty.
If you determine that WordPress is the cause of your MySQL problems, you can usually repair database tables that might be causing the problem. The first step is to verify each table’s integrity.
If you use phpMyAdmin, you can do the following:
1. Click the name of your database on the left-hand side
2. Click “Check All” at the bottom to select all tables
3. From the drop down menu, select “Check table”
4. If you find some tables do not have the status “OK”, choose “Repair table”
5. Select tables again and choose “Optimize table”
This may not fix all database problems, but it is a good place to start if you ever experience any. Normally, WordPress should not make MySQL crash. It is possible if it does that you have a memory issue or even a bigger problem such as an uninvited guest on your server. For manual MySQL optimization from the command line, visit serverschool.com.