I'm running MySQL server on a WinXP box at home. I have a cable
modem/router. I've set up port forwarding on port 3306 to the machine
running MySQL. I can connect locally just fine, but when I try to
connect from a remote location using:
mysql -h xxx.xxx.xxx.xxx -P 3306 -u root -p mysql
I get:
ERROR 2003: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061)
When I try:
mysqladmin ping -h xxx.xxx.xxx.xxx
I get:
mysqladmin: connect to server at 'xxx.xxx.xxx.xxx' failed
error: 'Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061)'
Check that mysqld is running on xxx.xxx.xxx.xxx and that the port is
3306.
You can check this by doing 'telnet xxx.xxx.xxx.xxx 3306'
And telnet yields:
Connection To xxx.xxx.xxx.xxx...Could not open connection to the host,
on port 3306: Connect failed
All of this seems to indicate that the server is not running, but if I
point Internet Explorer to the IP address ("xxx.xxx.xxx.xxx:3306") I
get a response in the form "1 4.0.17-max-debugd4qaq4Nl, ". The text
after debug is always gibberish. It changes every time I refresh the
page. Incidentally, when I try to connect locally using telnet, I get
the same thing. It gives the version followed by max-debug, followed
by gibberish, then it disconnects after a few seconds with message
"Connection to host lost.". If I type anything within those few
seconds, it says "Bad handshake" before the final message. Finally, a
simple JSP I've written, which also works locally, fails to connect
remotely. My question: How do I connect to MySQL remotely?