error establishing a database connection

I know this question is asked like a million times, but I can’t find an answer for my problem.

This problem is happening in a user of my server (my father’s blog actually), and as he told me: “Just finished a post and was editing the text and the image layout when the site froze. Then tried when a different opened tab but couldn’t do anything either”.

Since then, the famous “error establishing a database connection” has been there.

This is the information I can give:

  • The wp-config file is correct (it was working before and has not been changed. Also, I checked it)
  • The MySQL server is working fine, and I can connect to the database with a small PHP script, and select the database
  • The tables of the database need no repair (I also run the mysqlrepair tool)
  • There’s no .maintenance file

Actually, in the functions.php:is_blog_installed() it couldn’t find the siteurl option and as it’s not repairing, the function returns false…

Any idea why or how to recover the blog?

1 Answer
1

Are you still facing the issue? I might be able to help you out.

Here are some more reasons why it might be happening:

  • A corrupted database – Bad plugins, addons, themes and data-transfer interruptions might leave your database short of tables or completely corrupted at worst.

  • Corrupted WordPress files

Found this on: http://www.wpkube.com/how-to-fix-error-establishing-database-connection-in-wordpress/

Leave a Comment