I've set up a virtual host on my local machine (windows xp with xampp installed), have installed zend there and am now trying to connect to the MySQLdatabase. I get the following error message:

Message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on ''myhost.com'' (10060)

All the tips I've found via google haven't helped. I use kaspersky antivirus and have added port 3306 to the allowed list for MySQL and Apache. I've also pinged myhost.com:3306 and get a response (with ip address 67.63.50.51), though localhost:3306 and 127.0.0.1:3306 aren't found. I've checked that other apps can still access MySQL if the virtual host is pointed at them instead and my non zend apps do work.

I guess I have to do something further to the port, or maybe force the app to use a different port, but am not sure how to do either.

Any help appreciated.

link|improve this question
feedback

1 Answer

localhost:3306 and 127.0.0.1:3306 aren't found

ping cannot be used to verify a port's state, as it's in a different TCP/IP layer and doesn't use a port. Try

telnet localhost 3306

If you can connect, you should see a number of unintelligible characters. This is the MySQL connection ready string.

It seems other apps can access MySQL - when Zend is configured, try running xampp-portcheck.exe (in your xampp root) and, if all's ok, starting xampp-control.exe to ensure the MySQL service is running (although it seems likely it is).

I've also pinged myhost.com:3306 and get a response (with ip address 67.63.50.51),

Is 67.63.50.51 your internet facing IP address? It you are setting this up for local dev you're better off configuring the vhost's hostname in your C:\WINDOWS\system32\drivers\etc\hosts file and directing it to 127.0.0.1 - if 67.63.50.51 isn't your address, you're testing another server (it currently redirects to a Dutch holding page).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.