Wednesday, May 16, 2012

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

mysql> GRANT SELECT ON *.* TO 'gita'@'localhost' IDENTIFIED BY PASSWORD "gita123";
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

# Check encripted password on Mysql Console.
mysql> select password('gita123');
+---------------------+
| password('gita123') |
+---------------------+
| 1f6f58c9269d50dc |
+---------------------+
1 row in set (0.00 sec)

# Check Grant for User
mysql> show grants for gita@192.168.10.143;
+-----------------------------------------------------------------------------------------------------+
| Grants for gita@192.168.10.143 |
+-----------------------------------------------------------------------------------------------------+
| GRANT SELECT, SHOW VIEW ON *.* TO 'gita'@'192.168.10.143' IDENTIFIED BY PASSWORD '1f6f58c9269d50dc' |
| GRANT SELECT, SHOW VIEW ON `data1`.* TO 'gita'@'192.168.10.143' |
| GRANT SELECT, SHOW VIEW ON `data2`.* TO 'gita'@'192.168.10.143' |
+-----------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

# Update Password In Query.

mysql> GRANT SELECT ON *.* TO 'gita'@'localhost' IDENTIFIED BY PASSWORD '1f6f58c9269d50dc';
Query OK, 0 rows affected (0.04 sec)


Resolved.!