I installed ZWAMP 1.0.7 (on Windows 7), but I'm having a weird problem. I can't connect to my MySQL server from any PHP script. If I try to use MySQL command line everything works fine but PHPMyAdmin retruns error #2002. I'm not sure whether it's important or not but MySQL server is not able to create socket file. I don't know what's the problem but I think everything is configured in my.cnf properly.

Do you have any ideas?

  • Do you have more error messages in either the httpd log or the mysql log? And can you create a pretty simple PHP script where you try to connect to mysql. And then tell us what error messages you get then... And yes, it is very important that mysql can not create a socket. You have to solve this problem. Probably the path to the file is wrong in the config file. – Raffael Luthiger Nov 26 '11 at 1:24

That PHPMyAdmin error relates to a problem connecting to MySQL over a socket, maybe it's been configured to connect over a UNIX socket which Windows 7 doesn't support? See if you can configure it in the config file to connect to instead of localhost as this should force a TCP/IP connection instead of a socket.


The MySQL CLI uses a named pipe to connect to the MySQL Server. PHP (almost always) uses IP networking to connect to the server.

Is the MySQL server listening for TCP/IP connections? Is your firewall allowing connections to port 3306 (The default MySQL port)?

Try to telnet localhost 3306 to see if you get any prompting or feedback from the MySQL daemon.

  • The response is "5.1.45-community♦VC+M$ha1!☻kJmf8'V\LHb8". As I said mysql server works fine but I jsut can't connect from any PHP script. – martin Apr 27 '10 at 16:09
  • There goes my theory. – Joe Apr 27 '10 at 17:28

I had a similar problem after I migrated my local testing environment from Windows XP to Windows 7. Specifying the IP address instead of localhost in the config.inc.php file of the PHPMyAdmin did the trick.

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.