[mysql@v157-7-154-209 ~]$ make_replication_sandbox 5.7.6 --how_many_slaves=2
installing and starting master
ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password('msandbox')' at line 1
mysqldump: Got error: 1045: Access denied for user 'msandbox'@'localhost' (using password: YES) when trying to connect
can't load grants
error installing the master
(512 )
Syntax Error…?
手で打ってみた。
mysql> SET PASSWORD= PASSWORD('root_password');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('root_password')' at line 1
( ゚д゚) ファッ!?
なんか変だと思ってmysql.userテーブルを探してみたら、passwordカラムがなくなっていたことに気付いたがそれは別のエントリーに置いておいて、
日々の覚書: MySQL 5.7.6でmysql.userテーブルのパスワードのカラム名がなんか変わった
SET PASSWORDステートメントはPASSWORD関数を通さなくても勝手にハッシュするようになったぽい。
(なので、変にPASSWORD関数の戻り値を渡してしまうと、ハッシュ後の値が元のパスワード値と認識されちゃうから敢えてエラーになっている…?)
mysql> SET PASSWORD= 'root_password';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT user, host, authentication_string FROM mysql.user;
+------+-----------+-------------------------------------------+
| user | host | authentication_string |
+------+-----------+-------------------------------------------+
| root | localhost | *2AF14BD74D8A4FDB580D3208C0092BE75EE95B75 |
+------+-----------+-------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT PASSWORD('root_password');
+-------------------------------------------+
| PASSWORD('root_password') |
+-------------------------------------------+
| *2AF14BD74D8A4FDB580D3208C0092BE75EE95B75 |
+-------------------------------------------+
1 row in set (0.00 sec)
ちゃんと合ってる。
敢えてエラーにするのはいいことだと思うけど、Syntax Errorは違うだろう。。
ちなみに5.7.5以前のバージョンでやると、5.6までの挙動と同じで
mysql57> SET PASSWORD = 'root_password'; ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
こうなる。
うわー、非互換かぁ。。これいろいろつらい気がする(自動セットアップ系の何かで)
MySQL :: MySQL 5.7 Release Notes :: Changes in MySQL 5.7.6 (2015-03-09, Milestone 16) に Incompatible Changeとして載っているので、バグではないぽい(ばぐれぽ上がってたけど)
【2015/06/01 18:54】
In MySQL 5.7.6, the PASSWORD() function was deprecated, but no warning was produced when it was invoked. Similarly, the old_passwords system variable was deprecated, but no warning was produced when it was set. (Bug #20545464)MySQL :: MySQL 5.7 Release Notes :: Changes in MySQL 5.7.7 (2015-04-08, Release Candidate)
ということで、ちゃんと(?)ワーニングで返してくれる猶予期間が設けられたようなのでした。よかった。
mysql> SELECT @@version;
+-----------+
| @@version |
+-----------+
| 5.7.6-m16 |
+-----------+
1 row in set (0.00 sec)
mysql> SET PASSWORD = PASSWORD('abc');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('abc')' at line 1
mysql> SELECT @@version;
+-----------+
| @@version |
+-----------+
| 5.7.7-rc |
+-----------+
1 row in set (0.00 sec)
mysql> SET PASSWORD= PASSWORD('abc');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> SHOW WARNINGS;
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'SET PASSWORD = PASSWORD('')' is deprecated and will be removed in a future release. Please use SET PASSWORD = '' instead |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
Bug #20552143 SET PASSWORD=PASSWORD(...) SHOULD BE SUPPORTED, BUT DEP… · mysql/mysql-server@a14f794
0 件のコメント :
コメントを投稿