PC を localhost としてではなく、別の場所でホストされているリモート DB に接続しようとしましたが、接続するたびに (ライブ サーバーとまったく同じパスワード、ホストなどを使用して)、次のエラーが発生します。
Warning: mysql_connect() [function.mysql-connect]: Premature end of data
(mysqlnd_wireprotocol.c:553) in C:\xampp\htdocs\Test\auth.php on line 12
Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter
than expected in C:\xampp\htdocs\Test\auth.php on line 12
Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to
MySQL 4.1+ using the old insecure authentication. Please use an
administration tool to reset your password with the
command SET PASSWORD = PASSWORD('your_existing_password').
これにより、新しい、より安全なハッシュ値が mysql.user に保存されます。このユーザーが PHP 5.2 以前で実行される他のスクリプトで使用されている場合、C:\xampp\htdocs\Test\auth.php の 12 行目の my.cnf ファイルから old-passwords フラグを削除する必要がある場合があります。
Could not connect to host:mysqlnd cannot connect to MySQL 4.1+ using the
old insecure authentication. Please use an administration tool to reset your
password with the command SET PASSWORD = PASSWORD('your_existing_password').
This will store a new, and more secure, hash value in mysql.user.
If this user is used in other scripts executed by PHP 5.2 or
earlier you might need to remove the old-passwords flag from your my.cnf file
私は何を間違っていますか?
編集:まだ取得できません。xamppを更新してみました。
編集:
SELECT Length( PASSWORD( 'xyz' ) )
これにより、ローカルホストで 41 が返され、サーバーで 16 が返されたので、my.cnf に old_passwords=1 を追加し、mysql を再起動して、両方とも 16 になりました。同じエラーが引き続き発生します。
編集:まだ無知ですが、他の人には機能しますが、私には機能しません...
編集:グーグルで試し、いくつかの修正を試みました。どれも機能しませんでした。