我有以下php代碼連接到我的mysql數據庫。php MySql連接錯誤
mysql_connect("myserver.com" , "root", "redhat","datastore") or die(mysql_error());
,當我跑這個代碼,我得到的錯誤說:
Warning: mysql_connect(): Host '10.21.21.10' is not allowed to connect to this MySQL server in C:\xampp\htdocs\inventory\net.php on line 20
Host '10.21.21.10' is not allowed to connect to this MySQL server
但myserver.com當我命令做平myserver.com提示IP它給了10.25.15.95
,所以改性的代碼:
mysql_connect("10.21.21.10" , "root", "redhat","datastore") or die(mysql_error());
在SAM重複錯誤。
然後,我改變了我的代碼:
mysql_connect("10.25.15.95" , "root", "redhat","datastore") or die(mysql_error());
錯誤是
Warning: 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. in C:\xampp\htdocs\inventory\net.php on line 20
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.
請幫我解決這個..提前
謝謝...
你的遠程服務器不允許你的ip連接。請聯繫您的主機提供商 –