Error establishing in database connection

I have a WordPress site which works perfectly. But some times when I refresh the page several times using F5 key, then my site goes down for several minutes or for about half an hour and shows message

“Error establishing in database connection”.

Read More

My database user name , password , host etc all are right. And my site works perfectly. But it shows this error only some times. If database connection are not perfect then it must show this message all the time. I have also written custom database connection in seperate files.

Related posts

1 comment

  1. Most of the time this error message is caused by a problem in the wp-config file.

    Add this code in wp-config.php

    define(‘WP_ALLOW_REPAIR’, true);

    yourdomain.com/wp-admin/maint/repair.php

    Click repair and optimize button to repair your database.

    Make sure you remove this line of code after you have fixed your database connection error message.

    If you still have this issues, contact your hosting provider. They will fix this easily.

Comments are closed.