我想连接我的 php 应用程序(在我办公室)和我家里的数据库,
mysql_connect('119.92.59.55','root','lester1992')
但他们不相互通信(我的电脑和我的办公室终端),可能是什么问题?
这是我遇到的错误。
mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
提前致谢。
最佳答案
您需要在 mysql 中授予访问权限才能从远程主机访问。
GRANT ALL PRIVILEGES
ON database.*
TO 'user'@'your_office_ip_address'
IDENTIFIED BY 'newpassword';
关于php - 公共(public) IP 地址作为我在 mysql_connect() 中的主机名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22032892/