Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"Error establishing a database connection" on websites using mysql database

Posted on 2013-01-10
4
Medium Priority
?
536 Views
Last Modified: 2013-01-21
All wordpress sites on my server were working fine until I received an email from google saying that it's bots couldn't crawl one or two of the site.   (that a owner didn't pick the issue up first is amazing, but anyway...)
When I try to access a site there is a message "Error establishing a database connection".

On the server, when I try to use phpMyAdmin to see what is going on there is a error connecting to localhost.

After much stuffing about, I can now log into PMA, can see the databases and their data, can see the user accounts that each site should be connecting with yet still have the aforementioned error.

How can I fix this?

FYI:
Windows Server 2008 R2 Standard (IIS 7.5)
MySQL 5.1.66
PHP 5.4
0
Comment
Question by:Reece Dodds
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38766076
I get emails like that from Google now and then.  By themselves, they don't mean much and they certainly can't cause the problem.  

Did an IP address change somewhere?  Are you connecting to 'localhost' using PMA?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38766083
I did have a problem like that on Godaddy last year.  For a day, their internal DNS went down and the databases were being selected by name.  I changed it over to the IP address and the problem went away.  A few million web sites were pissed at Godaddy for a while for that.
0
 
LVL 7

Accepted Solution

by:
Reece Dodds earned 0 total points
ID: 38784883
something happened to the main database...   It seemed to have lost all of the passwords assigned to the users.  And had lost which users connected to which database.

So all of the connection settings that each wordpress site had it their wp-config.php files was useless.

I added the users, permissions and then changed the passwords for each.
Restarted the server and all is good again.

Not sure how or why this happened, but I've changed the security settings for  MySQL, server remote access and FTP access just in case.
0
 
LVL 7

Author Closing Comment

by:Reece Dodds
ID: 38800534
self resolved.

Thanks to the members who contributed though.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question