1

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?

1
  • 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. Commented Nov 26, 2011 at 1:24

3 Answers 3

1

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 127.0.0.1 instead of localhost as this should force a TCP/IP connection instead of a socket.

0

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.

2
  • 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. Commented Apr 27, 2010 at 16:09
  • There goes my theory. Commented Apr 27, 2010 at 17:28
0

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.