Easiest WordPress Database repair

Following the latest WordPress Update release that was supposed to help with some security fix but ended up sabotaging over 234.987 websites. Our IT section had to do some overnight fixing and just as we were done, I decided to put this up to help me for my future fixes, educate Interns, or anyone else.

So there are tons of advice on fixing the database, from checking your database username and password to checking database host information as well as updating the SQL info in the SQL Server and checking if the database server is not down. Honestly, most are just guesswork but after trying a ton of restores and fixes we applied the most basic config file update and the fix was quick and smooth.

No matter the issue, as soon as you see the database in the error message, just apply the following:

Just add the following line in your wp-config.php file

1
define('WP_ALLOW_REPAIR', true);

Config files are usually located in the public.html folder for Cpanel users, Win users can check in the httpsdocs folder. Right-click the config.php file and select edit to update the file online or download and use notepad to update and reupload. Make sure to add it just before ‘That’s all, stop editing! Happy blogging’ line wp-config.php.

Once you have done that, you can see the settings by visiting this page: https://www.siteaddress.co.za/wp-admin/maint/repair.php.

Once done, revisit your main domain https://www.siteaddress.co.za/ and all should be back in working order.

 

Leave a Reply