It doesn't make much sense.
Here is what you get if you just do
set password = password('123')
|
+------+-------------------------------------------+
|
| user | password |
|
+------+-------------------------------------------+
|
| root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
|
Same happens if you do
set password = password('1\23')
|
+------+-------------------------------------------+
|
| user | password |
|
+------+-------------------------------------------+
|
| root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
|
(understandably)
Same happens if you enter 123 or 1\23 in the current (unpatched) version of mysql_secure_installation:
+------+-------------------------------------------+
|
| user | password |
|
+------+-------------------------------------------+
|
| root | *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 |
|
All of these allow you to connect via mysql client using 123 as a password, also understandably.
Now, to be able to connect via mysql client using 1\23 as a password, you need to do
set password = password('1\\23');
|
And you'll get
+------+-------------------------------------------+
|
| user | password |
|
+------+-------------------------------------------+
|
| root | *4D617476C30310C15DB73E333FA5CC4E555B3BDA |
|
But if you patch mysql_secure_installation the way you suggested, and then enter there 1\23 as a new password, you'll get this:
+------+-------------------------------------------+
|
| user | password |
|
+------+-------------------------------------------+
|
| root | *6CE27BDC6F768BB235AA78F24453062FAEEC9A6F |
|
(and btw same happens if you enter 1
23 in the unpatched version).
There is no way mysql client should successfully connect using 1\23 now, since the stored encrypted password is obviously different from the one which does allow it to connect with 1\23 (*4D617476C30310C15DB73E333FA5CC4E555B3BDA, as described above)
If you are really able to do the described and still connect to the server, i can only attribute it either to an oddity of a library, or, which is rather frightening, to a possible security problem. If that's indeed so, please provide the similar data (encrypted password for each case), so we could see where things go wrong. It will probably deserve a separate report, though.
Meanwhile, the current request relates to the upstream issue, I suggest you to file it at bugs.mysql.com since we'd have to maintain compatibility with their version of the script anyway (otherwise many more things might break when people migrate).
Upd: well, thinking about it, maybe it's an oddity of my library, as there is no glaring obvious reason why the password set through mysql_secure_installation should produce a different hash. So maybe it just works for you, but not for me.
Hi Krzysztof,
But as you said, mysql -uroot -p does not accept 1\23 password. So what will happen if you enter it with the modified version of mysql_secure_installation? It will be accepted and stored with the backslash, but the root won't be able to connect to the database using mysql client because it won't accept the password with the backslash. The how do you expect the Fix 1 to work?