This error occurs when WordPress cannot connect to its database. Follow these steps to fix it:
- Check wp-config.php: Login to cPanel > File Manager and find
wp-config.phpin your site root. - Verify that
DB_NAME,DB_USER,DB_PASSWORD, andDB_HOSTare correct. - Verify Database User: In cPanel > MySQL Databases, ensure the user is added to the database with "All Privileges".
- Check Database Corruption: Add
define('WP_ALLOW_REPAIR', true);towp-config.php, then visityourdomain.com/wp-admin/maint/repair.php.
Don't forget to remove the repair line from wp-config.php after you're done!