0

Im trying to gain access to a mysql database hosted by one site from another website.

In short I am in the middle of transferring from one host to another of my website. I have imported my database from host A to host B, and also uploaded my website. Host B is now up and running but I want to keep Host A going for a while until people move over to the new host.

So I want host A to use the db on host B.

I have turned on remote mysql on host B and added the shared ip address of my website of host a. This I believe should allow host a to connect to the db on host B.

I have changed the connection details in my php script to the user,db,password details of the db on host b.

But i'm getting a connection error of cannot connect to db.

I have added my home ip address, created an odbc connection on my pc and used access to connect to the db on host b, with success so I know that host is accepting connections remotely.

I have also tried adding the web address of the my site on host A to the remote mysql, and tried using a open wildcard of '%' hoping that would let any remote connection, but still no look.

Is it possible that host a has blocks on connecting to external mysql databases or am i missing something simple?

Help would be appreciated.

4

1 回答 1

0

检查您的防火墙是否允许通过端口 3306 进行连接。

检查 my.cnf 中的 MySQL 配置参数 bind-address 以确保它允许远程连接。

这里有信息和故障排除提示:

http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html

我希望这篇文章可以帮助您调试这个问题 Can't Connect to MySQL Server on IPAddress (10061)

于 2013-08-21T07:50:19.740 回答