Solved

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

Posted on 2013-01-10
4
532 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 83

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 83

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Node.js 11 82
Testrail - Active Directory integration. 4 35
How to prevent duplicates in dropdown when using dynamic and static data 5 47
Joomla Editing 3 24
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

710 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