“Error Establishing A Database Connection” Error In Xampp MySql
I have setup xampp local server with MySql on my Windows 7 machine. Basically this was to setup a wordpress blog on localhost to test features before rolling out here on this live blog. My machine has McAfee Antivirus protection which also handles firewall. Everything was working fine until one day I saw a McAfee notification about xampp.exe. Which stated three options “Allow Always”, “Allow Once” and “Block”. I thought it might be security risk to allow internet connection to connect with xampp. So I blocked xampp.exe. And problem begun.
The Problem
Now when next time I started xampp control panel and tried to start apache and mysql, they were behaving like Busy, Can’t stop, Can’t start, -1 response etc. Even if I started them and tried to access my blog on localhost like “http://localhost/blog” I got a big bold “Error establishing a database connection”. When I tried to access phpmyadmin, it slumped “Access denied” and “#2003 – The server is not responding”.
I tried to find this problem on forums, blogs and any other resource which had a faint sign of xampp, mysql along with these errors, at no avail.
But while trying to figure out this problem online, there were traces of McAfee being the culprit. So I digged in some more and bingo – I couldn’t find anything !! So I gave a shot to McAfee directly to find out the solution.
The Solution
I opened McAfee Security Center and went to Firewall settings.
In that go to Program Permissions.
You’ll see Apache HTTP Server listed when scroll down, which is in Block state.
Now click on Edit. It will open up Edit Program screen.
For security reasons click “Outgoing” from drop-down menu of Access. Save.
And Bingo!! Everything’s working fine.
See below screen shots of the steps for better understanding of the solution.
1) McAfee Security Cetner

2) Firewall Program Permissions

3) Apache HTTP Server Blocked

4) Apache Permission Set To Outgoing

Hope this helped solve your problem. If it did, then don’t forget to Like, share or comment.

















5 Comments
Mel
05.13.2011
Youre a life saver!!! THANKS!
Robin
08.02.2011
McAfee occasionally asks me if I want to accept an incoming connection to Apache. Why is this happening and should I block these requests because they are security risks?
Divyang
08.03.2011
Robin, don’t block the request for Apache. You should accept it. There is no problem whatsoever.
Flanker
12.19.2011
You have to bug mcafee to get editing permission on it.
they come for free, take control of the firewall for you, stop being free and leave you stuck…
Monaly
11.29.2012
Hey Praval!Sometimes you just have to jump in with both feet when you’re trying siotehmng new. Glad it worked for ya.Keep writing and stop by again!
Tweets that mention “Error Establishing A Database Connection” Error In Xampp MySql | GoosPoos -- Topsy.com
07.12.2010
[...] This post was mentioned on Twitter by Gaurang Patel. Gaurang Patel said: “Error Establishing A Database Connection” Error In Xampp MySql: I have setup xampp local server with MySql on m… http://bit.ly/alcQ3p [...]
There are no trackbacks to display at this time.