如何从MySQL旧密码升级到新密码系统 [英] How to upgrade from MySQL old passwords to new Password system

查看:208
本文介绍了如何从MySQL旧密码升级到新密码系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql服务器5.0中有很多用户(特权). 我想将所有这些都转移到新的MySQL服务器5.5中.但是密码是旧格式的(在mysql.user表中).因此,我想将所有旧密码转换为新格式.

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.

是否可以在不更改密码的情况下转移和升级MySQL密码?

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

推荐答案

假设您知道可以使用的密码

Assuming you know the password you can

set password = password('samepasswordasbefore');

在服务器或会话的old_passwords设置为关闭之后.

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

set old_passwords = 'OFF';

set [session] old_passwords = 'OFF';

服务器不在乎/知道与以前的密码相同.

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

因此,尽管从安全角度考虑,您应该更改密码,因为旧的密码可能已被破坏,因此没有运行软件的风险.当然,最好强迫它们定期更改,在这种情况下,您可以将old_passwords设置为OFF并等待.

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.

批量设置密码并不是一件容易的事,但是如果old_passwords已关闭一段时间,那么用户中只有几个带有旧短哈希的帐户.您至少可以将尚未更新的那些识别为在用户表中具有较短哈希的那些.

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.

这篇关于如何从MySQL旧密码升级到新密码系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆