How to optimize MySQL database?

If you have deleted a large part of a table or if you have made many modifications to a table with variable length rows, such as VARCHAR, TEXT, BLOB or VARBINARY columns then you may use Optimize Table option.

Optimize Table reclaims any unused space and defragments the data file for optimal performance.  If a lot of modifications have been made to a table, optimizing the table can sometimes significantly improve the performance.

Here I’m going to walk you through the steps to optimize your MySQL Database.

  • Login to your cPanel account and search for phpMyAdmin and click on it.
  • cPanel will redirect you to a new page and you will see phpMyAdmin’s Dashboard as below:
  • From the Left pane, select the database you want to optimize, which should take you to the Structure tab of the database.
  • Select the tables you wish to optimize by checking the check box in front of each one, or in case you want to optimize all the tables you can select all by going to the bottom of the page and checking the box in front of Check all option.
  • From the the drop down box that says With selected: select Optimize table.  This option will optimize the table you have selected.

Once the query is completed, you will see a success message indicating that the Optimization has been completed.

Was this article helpful?

Related Articles