Repair WordPress database
Repairing and optimizing the WordPress database is a necessary task when our blog has been online for a while. Repairing the database becomes a necessary step when we observe anomalies in the operation of our WordPress blog.
In an old blog I remember that it started to give me problems, since I published an entry but they were not shown on the blog, because after many tests I came across the bug, I simply had to repair the database and the new articles that I had published They were displayed on the blog.
If you have any problem in your WordPress, some malfunction may be that your database has been damaged , so this step is a good way to start to rule out problems with the database.
Optimizing the database is also useful in large blogs, since it allows us to keep the database optimized and allow faster access, so the response time of the blog improves.
To repair and optimize the WordPress database there are two ways: use WordPress itself by editing a parameter in the
wp-config.php file or using PhpMyAdmin if our hosting provides it.
Repair the database using WordPress wp-config.php.
This is the option that I recommend the most. The first thing we have to do is edit the
wp-config.php file and add the following line
Once this is done, we can access the URL
http://miweb.com/wp-admin/maint/repair.php and we will be shown two buttons one to repair the database and another to repair and optimize the database .
It is highly recommended at the end of the repair of the database to re-edit the
wp-config.php file to remove the line that we have added before and thus avoid possible access are authorization.
Repair the WordPress database using PhpMyAdmin.
With this method the first thing we have to do is access the PhpMyAdmin and select the database of our blog.
Once this is done, all the tables will be shown, all of which must be marked and then select the option of the Repair the table drop-down menu, you can click on the following image to see an example of where these options are located.
Note for advanced users.
Only if your database uses the MyISAM engine accepts the option to repair, so if you are using another type of MySQL engine such as InnoDB, it will not support this option.
If you try to repair a database with the InnoDB engine using the PhpMyAdmin method it will return an error, but interestingly if you try to repair it using the WordPress
wp-config.php method it seems to work.