Search code examples
mysqlpassword-hash

Recover the passwords created using PASSWORD() in mysql 8


I have updated my existing MySQL 5.7 system into MySQL 8.0 All passwords are encrypted using MySQL PASSWORD() function.

PASSWORD() function is deprecated in MySQL 8.0

How can I recover my old passwords into new system?

Can I restore the old passwords? Is there a method to convert MYSQL hash password into another encryption?


Solution

  • Replaced this code part for PASSWORD() function and its working as expected.

    SELECT CONCAT('*', UPPER(SHA1(UNHEX(SHA1('PWD')))))