ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

Problem:

mysql> GRANT USAGE ON *.* TO 'moon'@'localhost' IDENTIFIED BY PASSWORD 'Jkt45s2';

ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

 

Solution:

Option:1

mysql> GRANT USAGE ON *.* TO 'moon'@'localhost' IDENTIFIED BY 'Jkt45s2';

Query OK, 0 rows affected (0.00 sec)

 

Option:2

mysql> SELECT PASSWORD('Jkt45s2');

+-------------------------------------------+

| PASSWORD('Jkt45s2')                       |

+-------------------------------------------+

| *CDE65254CC57BC0C3D0A85509B5CEA654126BF56 |

+-------------------------------------------+

1 row in set (0.00 sec)

 

mysql> GRANT USAGE ON *.* TO 'moon'@'localhost' IDENTIFIED BY PASSWORD '*CDE65254CC57BC0C3D0A85509B5CEA654126BF56 ';

Query OK, 0 rows affected (0.00 sec)

Comments