If you notice that all your child sites are missing from the Manage Sites table, it is more than likely that your database got corrupted, and it needs to be repaired.
First, check and make sure that the ANSI_QUOTES MySQL mode is not enabled on your Database. To do that, check the MainWP > Info > Server Information page and locate the MySQL Modes. Make sure it’s not listed:
Why does this happen, and how to fix it?
Databases can become corrupted for any number of reasons, from software defects to hardware issues. If this occurs, you can try to repair database tables by following these steps:
1. Using WP_ALLOW_REPAIR
WordPress comes with a database repair feature that allows you to fix the corrupted database without little technical knowledge.
- Connect via FTP to your website and download the
wp-config.phpfile. It is residing in the root folder of the WordPress installation.
- Open the wp-config.php file with a text editor and insert this line:
define( 'WP_ALLOW_REPAIR', true );to the end of the file, just before the
if ( !defined('ABSPATH') )line.
- Don’t edit or change any other stuff in the wp-config.php file unless you know what you are doing. Save the changes and upload this file back to your server. Make sure you overwrite the existing copy on the server.
- In your browser, go to the URL http://yoursite.com/wp-admin/maint/repair.php. Don’t forget to replace “yoursite.com” with your own website’s URL. This is what you will see:
- You can click either the “Repair Database” button or the “Repair and Optimize Database” button. Both will repair your database. Our recommendation would be the “Repair and Optimize Database” option since it optimizes your database as well.
- You should now see a bunch of code. Scroll down to the end of the page, and you should see “Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.” That’s it. Your database is now repaired.
- Lastly, remove the “WP_ALLOW_REPAIR” line from your “wp-config.php” file and re-upload it to your server.
2. Repair database via phpMyAdmin
If the above method doesn’t work, you can try the phpMyAdmin approach.
- Log in to your web host cPanel and open the phpMyAdmin module.
- On the left sidebar, click to select your WordPress database. (If there are multiple databases in your phpMyAdmin and you are not sure which one belongs to your WordPress site, check your wp-config.php file for the database name).
- If you have a good idea of which table is corrupted, select that particular table by placing a check beside it. If not, select all the tables in the list. At the end of the table, there is a dropdown bar. Click and choose the “Repair table.”
- phpMyAdmin will then proceed to repair your table(s). Once done, go back to your website and see if everything is working fine.
If all else fails, you should try to restore a recent backup of your MainWP Dashboard site database. This is where your backup database comes in useful. However, if that doesn’t help or you don’t have a backup, please reach MainWP Support.