admin管理员组

文章数量:1406945

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?

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?

Share Improve this question edited Jun 4, 2015 at 17:20 danikaze asked Jun 4, 2015 at 17:14 danikazedanikaze 1213 bronze badges 3
  • 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 Commented Jun 4, 2015 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 Commented Jun 5, 2015 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 Commented Jun 14, 2015 at 5:21
Add a comment  | 

1 Answer 1

Reset to default 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/how-to-fix-error-establishing-database-connection-in-wordpress/

本文标签: error establishing a database connection