phpMyAdmin Repair and Optimize Database Tables Tutorial

Sometimes, it might be necessary to repair a MySQL database table. This can be the case if your WordPress site acts weirdly or slowly.

So, for instance, when you notice that modified settings in your WordPress dashboard are not permanently saved, it could indicate a corrupted database table.

Another indicator for a corrupted MySQL table can be if you get errors like this:

Table './wordpress/wp_redirection_404' is marked as crashed and should be repaired.

You can quickly fix this with the repair tool built-in with phpMyAdmin[1] and Adminer[2].
(Adminer is an easy to use one file DB administrating alternative to phpMyAdmin)

How to Repair MySQL Database Tables

First of all, open the phpMyadmin database administration tool.
Open the Databases tab and select the database you want to repair.

Select all tables that need repair. You can select all of them if you are unsure what table is corrupt.

Repair and optimize mysql database tables with phpmyadmin
How to repair MySQL database tables with phpMyAdmin

From the With Selected drop-down menu, choose Repair Table. Then all the tables will be repaired automatically. After that, you will get a presentation of the result of the repair operation.

How to Optimize MySQL Database Tables?

Optimizing database tables is needed from time to time. A MySQL database stores a lot of unused temporary data, such as queries or even data marked as deleted. So whenever you remove something from your databases, like a post or other data, it will not be deleted permanently immediately all the time. Sometimes, it still takes up some space in the system memory.

Optimizing a MySQL database table will permanently delete all this unnecessary data. So, it’s necessary to maintain your database from time to time to keep it clean and fast.

To optimize your MySQL tables, select all of them in phpMyAdmin, and choose Optimize table from the With Selected drop-down menu.

After a few seconds, you will get the result of the optimizing operation.