Bug #118957 | Documentation says you can use a HEX value for ALTER user passwords, but you can't. | ||
---|---|---|---|
Submitted: | 8 Sep 12:24 | Modified: | 8 Sep 15:18 |
Reporter: | IGG t | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 8.0.35 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[8 Sep 12:24]
IGG t
[8 Sep 14:18]
MySQL Verification Team
The syntax is different for the hex version. IDENTIFIED BY vs IDENTIFIED WITH .. AS .. See my example and let us know there's any doubt. mysql> create user myself@'%' identified by '12345'; Query OK, 0 rows affected (0.02 sec) mysql> show create user myself \G *************************** 1. row *************************** CREATE USER for myself@%: CREATE USER `myself`@`%` IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$O\'cK#[\\q^BJ%/ar^pKAoeGHQGadZBwM/P3xGZq5XNIuxeB6HHMNJOyOfIF.' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT 1 row in set (0.00 sec) mysql> set @@session.print_identified_with_as_hex = 1; Query OK, 0 rows affected (0.00 sec) mysql> show create user myself \G *************************** 1. row *************************** CREATE USER for myself@%: CREATE USER `myself`@`%` IDENTIFIED WITH 'caching_sha2_password' AS 0x244124303035244F1327634B235B5C715E02424A4C08252F61725E704B416F654748514761645A42774D2F503378475A7135584E49757865423648484D4E4A4F794F6649462E REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT 1 row in set (0.00 sec) mysql> drop user myself@'%'; Query OK, 0 rows affected (0.00 sec) mysql> CREATE USER `myself`@`%` IDENTIFIED WITH 'caching_sha2_password' AS 0x244124303035244F1327634B235B5C715E02424A4C08252F61725E704B416F654748514761645A42774D2F503378475A7135584E49757865423648484D4E4A4F794F6649462E REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT; Query OK, 0 rows affected (0.00 sec)
[8 Sep 14:21]
MySQL Verification Team
IDENTIFIED BY takes a plain text string for the password, not a raw hex hash value.
[8 Sep 15:18]
IGG t
It also appears you must include the "WITH CACHING_SHA2_PASSWORD" e.g. ALTER USER `user1`@`%` IDENTIFIED AS 0x2441243030352433644D30770A56593B23. . . Doesn't work, it has to be: ALTER USER `user1`@`%` IDENTIFIED WITH CACHING_SHA2_PASSWORD AS 0x2441243030352433644D30770A56593B23. . .