2011年11月5日土曜日

今さら人には聞けないMySQLの話(いにしえのold-passwordsオプション for MySQL5.5)



Perl使いもお世話になっていると思われるphpMyAdminで
MySQLにログインできないことが・・・・あった・・・。


#2000 MySQL サーバにログインできません


というわけで接続確認したところ


<?php
$dbh = mysql_connect("127.0.0.1","ユーザー名","パスワード") or die(mysql_error());


このようなエラーメッセージが、以下抜粋


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


つまり、MySQL4.1以前の古い安全ではない認証では接続できないので、
old-passwordsオプション外して、パスワード再設定してよ!ってことらしい。
http://dev.mysql.com/doc/refman/5.5/en/old-client.html

それならold-passwordsオプションで起動できないようにしてほしいような気もするが。
起動はできるしパスワードも設定できるんだな。
MySQL4.0など古いDBのデータ移行やmy.cnfの設定引き継いだ場合は注意が必要です。

というか、old-passwordsオプション使ってたんだ・・・。




0 件のコメント:

コメントを投稿