How to upgrade from MySQL old passwords to new Password system

混江龙づ霸主 提交于 2020-01-30 03:32:50

问题


I have a lot of users (privilages) in mysql server 5.0 . I want to transfer all of them into new MySQL server 5.5 . But the passwords are in old format (in `mysql`.`user` table). So I want to convert all old passwords to new format.

Is there any way to transfer and upgrading the MySQL passwords without changing them?


回答1:


Assuming you know the password you can

set password = password('samepasswordasbefore');

after old_passwords has been set to off for the server or the session.

set old_passwords = 'OFF';

or

set [session] old_passwords = 'OFF';

The server does not care/know that it is the same password as before.

As a result there is no risk to running software though from a security perspective you should change the passwords as the old one may have been compromised. Of course it would be even better to be forcing them to change periodically in which case you could just set old_passwords OFF and wait.

Doing the set password in bulk isn't going to be so easy but if old_passwords has been OFF for some time there should only be a few accounts with old short hashes in user. You can at least identify those that have not been updated as those with a shorter hash in the user table.



来源:https://stackoverflow.com/questions/8655997/how-to-upgrade-from-mysql-old-passwords-to-new-password-system

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!