views:

480

answers:

2

I've set up a virtual host on my local machine myhost.com, 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.

+1  A: 

10060 is just the error number. MySQL's default port is 3306. Try the same things you already tried, but using that correct port.

VoteyDisciple
Much as I hoped this would clear up the problem, I've retried everything with 3306 and the problem still persists
wheresrhys
A: 

The problem was a simple one in the end.

The tutorial I'm working through had quotation marks around its db connection details, and it turns out I needed to leave these out.

wheresrhys