5 Easy Fixes for Quick Error Establishing a Database Connection in WordPress:
- Check If Your Plugin or Theme Files Haven’t Been Corrupted.
- Check Your WordPress Database Credentials.
- Get In Touch With Your Web Host Provider.
- Repair a corrupt database with WordPress’ built-in database repair mode: define(‘WP_ALLOW_REPAIR’, true);
- Restore The Default WordPress Files
Read the full post here>> https://encodebyte.com/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/