4

PHP 5.3.10 を実行している開発サーバーで現在実行されているローカルで実行されているサイトを取得しようとしています。バージョン 5.5 の MySQL サーバーに接続しますが、にold_passwords設定されていONます。

サイトは開発サーバー上で動作します。

私のローカルでは、PHP 5.3.26 を実行しています。接続しようとすると、次のようになります。

Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: 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

これは old_password 変数の問題であることは理解していますが、これは PHP 5.3 の開発サーバーで実行されています。

編集:これが私のローカルmysqlセクションですphpinfo()mysql phpinfo

開発サーバーの mysql セクション: mysql phpinfo

開発サーバーと一致するようにローカルを設定するにはどうすればよいですか?

4

1 に答える 1

0

ここでは PHP のバージョンは問題ではありません。PHP 5.3 以降、「古い」MySQL パスワードはサポートされなくなりました。おそらく、2 つの異なる権限プロファイルが適用されています。同じサーバーに接続していますか?次に、次のようなことが起こっている可能性があります。

User       Host      
youruser   %           (using old-style password)
youruser   localhost   (using new-style password)

同じ資格情報を使用しているからといって、それらが同じアカウントまたはアクセス許可プロファイルを参照しているとは限りません。

于 2013-09-25T22:16:28.537 に答える