Error while executing the PASSWORD
function in MySQL Server version 8.0.12
I have the following query:
SELECT *
FROM users
WHERE login
If you need a replacement hash to match the password() function, use this: SHA1(UNHEX(SHA1())); E.g.
mysql> SELECT PASSWORD('mypass');
+-------------------------------------------+
| PASSWORD('mypass') |
+-------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------+
and replacement that gives the same answer in version 8:
mysql> SELECT CONCAT('*', UPPER(SHA1(UNHEX(SHA1('mypass')))));
+-------------------------------------------------+
| CONCAT('*', UPPER(SHA1(UNHEX(SHA1('mypass'))))) |
+-------------------------------------------------+
| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
+-------------------------------------------------+