-->
🏠 🔍
SHAREOLITE

How to solve MySQL ERROR 1827 (HY000)

When trying to create a user in MySQL 5.6 , got this error 

mysql> CREATE USER tida IDENTIFIED BY password 'tida123';
ERROR 1827 (HY000): The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.

Wondering how to solve it, well the solution is quite simple . In MySQL 5.6 - additional security measures are taken to avoid the user entering plain simple passwords 

How we fixed it :

By using hash value of the password as recommended by MySQL

Step 1 : Use password() function and get the has value of password

mysql> select password('tida123');
+-------------------------------------------+
| password('tida123')                       |
+-------------------------------------------+
| *AF63CFEA4EC006E3490BBFB0FB81DC0AF2921348 |
+-------------------------------------------+
1 row in set (0.00 sec)

Step 2 : Use this password in the create user statement

mysql> CREATE USER tida IDENTIFIED BY password '*AF63CFEA4EC006E3490BBFB0FB81DC0AF2921348';
Query OK, 0 rows affected (0.00 sec)
Comments

–>