Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot connect to Database in WP

The site had been working perfectly and then today while trying to login to WP Admin or the frontend i get an error message that WP cannot connect to Database. The username/password was never changed in the Godaddy console area.  Now it sometimes works and sometimes  get the error message, and some pages specifically the blog is very slow to load.


Anyone got any solution ?

Thanks for the help

Getting Started

Welcome to the community @yasmina

There are many reasons for something like this to take place, but narrowing the problem down may take a little work.

First check your wp-config.php file and make sure the database name, user name, and user password are correct.

Second disable all plugins (most likely the cause).  I've had issues with many different plugins, but something like this normally takes place with a cache cleaner.

Third switch back to the default theme, there is always a chance the theme itself is the problem.


Test after each of the above.  If you have disabled all plugins, by logging out and logging back in turn them on one at a time.  Be sure to clear your history and cache before logging back in. 


You could also post a link to your site so we can review it.  Sometimes with the use of tools like Firebug we would be able to identify the problem and see if a plugin is trying to interact with logging in.


Please post your results for others to see and good luck.  If you need additional assistance I am here to help.