DBサーバを切り替えたら、認証がうまくいかなくなる。
なぜ?
旧サーバのmysqlバージョンは4.1.11。
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 4.1.11-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select password('passtest');
+-------------------------------------------+
| password('passtest') |
+-------------------------------------------+
| *AD41292400F8520F470EF8ED3698816A1E0FF23A |
+-------------------------------------------+
1 row in set (0.00 sec)
パスワードはバイナリ41桁で*から始まる。
一時サーバのmysqlバージョンは5.0.21。
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 268 to server version: 5.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select password('passtest');
+----------------------+
| password('passtest') |
+----------------------+
| 3a1787ad25124783 |
+----------------------+
1 row in set (0.00 sec)
パスワードは16桁バイナリ。
たしかに、4.1以前については
パスワードは16桁。4.1以降は41桁のはず。
以下、5.0のマニュアルより。
If you perform a new installation of MySQL 5.0, the Password column is made 41 bytes long automatically.
Upgrading from MySQL 4.1 (4.1.1 or later in the 4.1 series) to MySQL 5.0 should not give rise to any issues in this regard because both versions use the same password hashing mechanism. If you wish to upgrade an older release of MySQL to version 5.0, you should upgrade to version 4.1 first, then upgrade the 4.1 installation to 5.0.
以下、訳(自力)。
MySQL5.0を新たにインストールした場合、Passwordの列は自動的に41バイト長で作られます。
MySQL4.1(4.1.1もしくは4.1シリーズ以降)から5.0へアップグレードする場合、どちらのバージョンも同じパスワードハッシュのメカニズム使うので、この点では問題ないんじゃない。 もしより古いバージョンから5.0へアップグレードするんだったら、まずバージョン4.1にアップグレードして、4.1から5.0にアップグレードさせたほうがいいんじゃない?
だそうです。
でもダメじゃん。
configオプションも見たけど、
それらしいところはないし。
infファイルか?
これから調査。わかったら追記します。
6.21追記
起動時のエラーログ。
[Warning] mysql.user table is not updated to new password format; Disabling new password usage until mysql_fix_privilege_tables is run
mysql.userテーブルは、新しいパスワードの形式へアップデートされてないよ。mysql_fix_privilege_tablesを実行するまで、新しい「password」構文?ってか新しい使い方はできないよ。
だって。
旧サーバのmysqlバージョンは4.1.11。
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1 to server version: 4.1.11-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select password('passtest');
+-------------------------------------------+
| password('passtest') |
+-------------------------------------------+
| *AD41292400F8520F470EF8ED3698816A1E0FF23A |
+-------------------------------------------+
1 row in set (0.00 sec)
パスワードはバイナリ41桁で*から始まる。
一時サーバのmysqlバージョンは5.0.21。
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 268 to server version: 5.0.21
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select password('passtest');
+----------------------+
| password('passtest') |
+----------------------+
| 3a1787ad25124783 |
+----------------------+
1 row in set (0.00 sec)
パスワードは16桁バイナリ。
たしかに、4.1以前については
パスワードは16桁。4.1以降は41桁のはず。
以下、5.0のマニュアルより。
If you perform a new installation of MySQL 5.0, the Password column is made 41 bytes long automatically.
Upgrading from MySQL 4.1 (4.1.1 or later in the 4.1 series) to MySQL 5.0 should not give rise to any issues in this regard because both versions use the same password hashing mechanism. If you wish to upgrade an older release of MySQL to version 5.0, you should upgrade to version 4.1 first, then upgrade the 4.1 installation to 5.0.
以下、訳(自力)。
MySQL5.0を新たにインストールした場合、Passwordの列は自動的に41バイト長で作られます。
MySQL4.1(4.1.1もしくは4.1シリーズ以降)から5.0へアップグレードする場合、どちらのバージョンも同じパスワードハッシュのメカニズム使うので、この点では問題ないんじゃない。 もしより古いバージョンから5.0へアップグレードするんだったら、まずバージョン4.1にアップグレードして、4.1から5.0にアップグレードさせたほうがいいんじゃない?
だそうです。
でもダメじゃん。
configオプションも見たけど、
それらしいところはないし。
infファイルか?
これから調査。わかったら追記します。
6.21追記
起動時のエラーログ。
[Warning] mysql.user table is not updated to new password format; Disabling new password usage until mysql_fix_privilege_tables is run
mysql.userテーブルは、新しいパスワードの形式へアップデートされてないよ。mysql_fix_privilege_tablesを実行するまで、新しい「password」構文?ってか新しい使い方はできないよ。
だって。
[コメント読む(0)]