Categories
Database How To Tips Wordpress

WordPress and Database Connection Error …

This week, I changed my WP Blog password and DB Password for that blog as well. And I did it using control panel provided by my hosting service provider. It went all well without any sort of error or so. But just today when I was trying to access my blog for some past reference, with my surprise my blog was displaying “HTTP Error 500” aka Internal Server Error for my IE9 which made no sense to me … but then I fired up my Chrome/Firefox and browse my blog it was stating “Database Connection Error” … Which was kind of self explaining … I had messed up with the database connection setup.

And it is all because I assumed that when I change password for my DB of WP in control panel of Host, it automatically configures WP to make it use the newer settings … but I WAS WRONG … it actually doesn’t … changing password for DB at Host only gives access to WP to use that password to connect DB to use, but how will WP know that it has to use new password instead of new password ?? Because if you have setup the self hosting WP blog then you know that.. we store DB connection strings (passwords,DB name, DB Username, DB Server Name) manually !! So, we hard code the password for database as well. And naturally, the password update thing in host doesn’t update password in my configuration file of WP lightbulb

So, once I realized this thing, I found the file which stores the configuration settings for WP … known as wp-config.php file … when I open that file to edit, I found that it was still using my old password … feeling being right about the root cause and having proof of it was good enough to “inspire” me to do some more research in it.

So once, I manually changed the password … it was working just fine !!smile_party

Moral of the story is…  if you ever wanted to change any of your settings for DB for WP, be sure to change them in wp-config.php or related files as well.

That’s it in this post…

It’s Just A Thought … fingerscrossed

Gaurang Sign

By Gaurang

First thing I would like to write is a question .... Why the hack people write their bio in 3rd person ?

I am Gaurang. I work as DBA / DEV for local company in CT. When I am not working, I am either reading other blogs n news OR "researching" / "experimenting" about things that I can do at home / at work OR tinkering with some new hardware/software OR playing games on my desktop.

If you ever wanted to contact me, I can be reached by meATgaurangpatel.net

Leave a Reply

Your email address will not be published. Required fields are marked *