Much of your blog’s performance depends on the performance of your database server and the database itself. Although there are many tricks you can do to make your MySQL database more efficient, one of the easiest and most common ways is to optimize your database tables. There are two ways to accomplish this: through the command line shell or through a graphical interface, such as phpMyAdmin.
To optimize a database in MySQL, you can run the following command:
mysqlcheck -op database-name
The “-o” will tell MySQL to optimize the database, and the “-p” option will tell it to prompt you for your MySQL password. This assumes, of course, that the user you are currently logged in as has access to the database. If not, you will need to specify the username as well:
mysqlcheck -op -u username database-name
To optimize a database in phpMyAdmin, do the following:
- Login to phpMyAdmin, and click on your database
- Select the the tables you want to optimize or select all of them with “Check All”
- In the drop down menu, select “Optimize table”
You should receive output telling you the tables have been optimized.
OPTIMIZE TABLE `wp_commentmeta` ,
Both methods accomplish the same thing, making your databse run more efficiently. It is a simple and sometimes very effective way to increase performance.