“Error Establishing a Database Connection” — How to Fix This WordPress Error
“Error Establishing a Database Connection” — How to Fix This WordPress Error: Part 1 of 2
“Error Establishing a Database Connection” — How to Fix This WordPress Error: Part 2 of 2
No related posts.


Brilliant. Wonderful. You saved my day. My whole website was doomed and it is now restored. Thank you so much for you clear exposition of how to troubleshoot the database connection problem.
Oh my God, Thanks a lot. You save my work and my current job as well.
Thanks again.
Thanks very much for the helpful videos! I’d like to add one bit of information for you — a simple solution that solved my database connection error without going through the steps that were outlined in the videos.
In the middle of the wp-config.php file there is a section titled “Authentication Unique Keys”. If you follow the directions there to reset the secret keys, then all who are logged in to the WP admin interface (including a potential hacker) will be kicked out and the cache will be cleared. The secret keys can be changed as often as you like. Be sure to set the CHMOD on the wp-config.php file to 400 for extra security.
Hope this info is able to help someone else out there!
@Ashia: Changing the keys will do what you explained, but that has nothing to do with connecting to the database.
Its really brilliant way to help people & defining through video sample…. i’ve a database error with my site : http://www.buying-annuities.org/ and solve by watching this video…. thnx a lot for helping us……
Ur my hero. Thanks!!!
Many thanks for this very clear tutorial. I have a question though: In my case, as I have learned from this tutorial, my Table prefix must have been incorrect as the WordPress Installation page came up.
My problem is that I went ahead and filled it in with the result that instead of the error message coming up I found that my site had vanished to be replaced by a brand new blog with the single Hello World! post in it.
Question: Is there any way I can recover my original blog? All the files appear to be in place on my server.
@Alan: All you need to do is find out what the table prefix is on your original blog…those tables will still be in the same database. Then open your wp-config.php file and change the prefix.
Thanks so much for posting this!!!
how do you find the new table prefix? mine was wp_ but changed the database and when the installation page popped up i accidentally registered again. and i really would like to switch it bk to the old blog because all my posts are gone. do help! thanks again!
@Geraldine: Just look in your current wp-config.php file and see what db you are using. Then open the db in phpmyadmin and you should see the tables. This ONLY applies to a self-hosted wp blog…if you are using wp.com, then you can’t do this.
I am using a self-hosted blog but thing is my server was also changed when the database was changed. and I don’t have any backups. but all my pictures and whatnots are still intact in my ftp server. (which is totally weird)
and what appears on my ‘table list’ are wp_comments, wp_users, wp_flagcomments and so on.. and i have no idea which i should use. i have tried all of them but i end up at the installation page all the time.
i am totally new to this so i am sorry!
but i appreciate you helping out!
my pics and music are all intact but i dont know where are my posts stored in. so i was wondering if i just had to change something else?
@Geraldine: Your posts are stored in the database. If you didn’t move the db from the other server as well, then you need to get it. Otherwise, without a back-up…you’re pretty much out of luck.
Thanks mate, you saved my site!
Thank you, Thank You, Thank You…I can’t say it enough. Your tutorial has relived a huge amount of stress for me. you are brilliant!
@Carlos: You’re welcome…glad they helped.
This video is a lifesaver. I’m new to hosting my own WordPress site, and I was sure that I’d have to uninstall and reinstall the whole thing. Thanks!
Thanks very much for making these two videos. I have an important site that was hacked, and these videos helped me to finally recover my admin status. Had never used phpMyAdmin before and your tutorial gave me the confidence to change my database… Would not have attempted this without your video assistance. You are a gentleman and a scholar!
@Steve: You’re welcome…glad it helped.
I am sorry, I don’t see this videos.
It worked! Thanks! My site had been down for a week and I couldn’t find the source of the problem. All I had to do was switch MySQL host name to “localhost”.
Thanks a lot for mentioning that GoDaddy doesn’t use localhost! It saved my day
Hello,
Unfortunately, after following your great videos, nothing worked. I have the right information, everything was correct in the DB, password, etc. It’s been hours on end, I still cannot figure it out.
this was soooo helpful. thank you!
Thanks a million!!!! I about had a heart attack when it stopped working. you were right, the password was wrong in my wp-config. Thank you, thank you, thank you!
thxs so much for this…
I wonder if you have anything on using other function on host panel?
Great tutorial! not sure why mine broke in the 1st place but following your video got my site back up and running, so thanks a lot!!
Thanks for a very clear set of instructions – wonderful!
This is a really excellent guide – the only thing I can’t seem to figure out is when I go into my Godaddy SQL database manager the database name and user names are not appended like they are in my current wp config file – so I don’t know how to make sure they are correct? I starting receiving this error even though I dodn’t change anything with my blog in the last few days it just stopped working.
Are there any references you could direct me to specific to GoDaddy’s listing of Databases and users?
@DessertBuzz: If you click on the database link in your godaddy control panel, you should see the db name and user name for each db you have.
You saved me as well with the video tutorial – easy to understand and follow. Lucky for me I am also hosted with Bluhost so it was even easier to understand. created a new user and that solved the problem. I don’t know why the old user got corrupted.
Thanks for the great tutorials.
hi..i tried all your tips but still error in establishment with database….
my webpage just loading ….loading….loading…….
i purly use tdo mini form for posting purpose …
here is some information might be useful for u
when i open phpmyadmin it will default show databases on left hand side but there is nothing just shows white space…but when i click on databases from menu it shows database ….but not open after click on that…
i request my host to resolve this problem but from 2 days there is no response….
Hello, Can you help me?
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at mysql509.ixwebhosting.com. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
Please help me to check the http://www.freeplrmrr.com/download/
I have the “Error establishing a database connection”
Thanks…
@Jay Soary: Other than what’s in the video, I can’t help…it must be one of those things.
Extremely grateful.
After watching these videos, I was able to fix the error message that a host company couldn’t do in a day!
Absolutely brilliant!
Thank you
Thank you – this is exactly the info I was looking for, and my problem is fixed!
Thanks for the videos. However, is there a way to test if the blog NEVER worked? I just installed everything for the first time, and I’m getting the “Error establishing a database connection” error. I think I have everything set correctly in wp-config.php. I know php is working (on my Windows server); I know the database and user is online and available (I’ve created a test table in my ‘wordpress’ database using my ‘wordpress’ user. And I have all the settings in the config file, using db_host ‘localhost’ but get the error.
Your videos assume that the blog is working, and then by changing certain items, you illustrate how to trouble shoot. If I can successfully do those other things (see a web page in php, get into the database through a command prompt), do you have any suggestions to trouble shoot the error? Thanks!
Fixed! In the absence of a working blog installation as a reference point, I went back to the database and deleted (dropped) everything related to my new installation. I dropped the database and user I had created for the blog, and started over. I created the database, created the user, and granted permissions to the user on the new database, and now I can get to the WordPress installation page!
Thanks for allowing me to think out loud!
ONE OF THE BEST TUTORIAL IN ANY CATEGORY!
RATE 5/5
Thanks for sharing. It’s a really great vedio tutorial………
Thank you, your video was very helpful. I was experimenting and wanted to ‘see’ wordpress via phpmyadmin but didn’t know the password. I changed the password and could access it but broke my wordpress web access. By checking the config file I could see what the pw was and changed it back… works again. Thanks again!
Genius!
I too am very grateful! Bleary eyed I had just about given up!
Your last suggestion worked to resolve hours of frustration, so glad you included it.
well done!
Thank you so much for your video. I was stuck for hours until I found you. In the video I noticed I needed the whole user name including the lead-in_ with that, I was back in. Thank you so much for uploading the video for us “mugs”
Crikey, figaro ur a legend – all fixed – thankyou so much – much more helpful than my host!!