2

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?

  • It's possible there is some issue with the network connection between your database server and your wordpress server. Have you verified connectivity has not been blocked between those two devices? – SuperTetelman Jun 4 '15 at 21:25
  • As I said, there's no problem with the server. I tested it with a small script. And everything is in localhost, so no communication problem... – danikaze Jun 5 '15 at 2:22
  • Are you able to export the database and import to a newly created database and then change the db credentials in wp-config.php to connect to. – neilgee Jun 14 '15 at 5:21
0

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/

  • forgot to comment here. Actually, it seemed a bad plugin or something (weird because it was working), so I just disabled some plugins from console and reinstalled wordpress... and now is working... – danikaze Jul 13 '15 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.