phpMySql接続エラー

PaDi

mysqlDBに接続するための次のphpコードがあります。

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.compingを実行したときのmyserver.comのIPは、10.25.15.95でした。

、だから私はコードを次のように変更しました:

mysql_connect( "10.21.21.10" , "root", "redhat","datastore") or die(mysql_error()); 

同じエラーが繰り返されました。

次に、コードを次のように変更しました。

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. 

これを解決するのを手伝ってください。

前もって感謝します...

フォーチュン

mysqlサーバーで:

mysql> mysqlを使用します。

mysql> CREATE USER'root '@' client_ipaddress 'IDENTIFIED BY'redhat';

mysql>すべての特権を付与します。TO'root '@' client_ipaddress 'WITH GRANT OPTION;

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事