私は次のようなPHPスクリプトを持っています:
$link = mysqli_connect("localhost", "gateway7_make", "$PASSWORD$");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
} else {
printf("Host information: %s\n", mysqli_get_host_info($mysqli));
}
そして、このスクリプトは一貫して出力します
Connect failed: Access denied for user 'gateway7_make'@'localhost' (using password: NO)
ウェブホストのパスワードを使用しない限り、その場合は出力されます
Connect failed: Access denied for user 'gateway7_make'@'localhost' (using password: YES)
「root@localhost」を使用しようとすると、上記と同じメッセージが表示されます。
同じマシンにインストールされているphpmyadminで動作するため、ユーザー名とパスワードが有効であることはわかっています。
スクリプト、mysqlサーバー、およびphpmyadminはすべて同じHostmonsterサーバー上にあります。
誰かが私が間違っていることを教えてもらえますか?