mysql升级 密码,如何从MySQL旧密码升级到新密码系统

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?

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值