Error while executing the PASSWORD
function in MySQL Server version 8.0.12
I have the following query:
SELECT * FROM users WHERE login = 'FABIO' AND pwd = PASSWORD('2018') LIMIT 0, 50000
I am getting this error:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
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 | +-------------------------------------------------+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With