gpt4 book ai didi

php - MYSQL 4 密码哈希 -> MYSQL 5

转载 作者:行者123 更新时间:2023-11-30 01:34:45 27 4
gpt4 key购买 nike

我遇到了一点麻烦。我的 mysql 4.1.0 数据库必须升级(1and1),但应用程序似乎使用 PASSWORD() 进行散列。随着 mysql 5 升级,PASSWORD() 给出了完全不同的结果,因此无法正确读取和验证密码。

OLD_PASSWORD() 似乎不会加密/解密到 4.1.0 版本,而是更早的 4.0 版本。

我能做什么?

最佳答案

"For compatibility purposes, the old_passwords system variable was added, to enable DBAs and applications control over the hashing method. The default old_passwords value of 0 causes hashing to use the 4.1 method (41-byte hash values), but setting old_passwords=1 causes hashing to use the pre-4.1 method. In this case, PASSWORD() produces 16-byte values and is equivalent to OLD_PASSWORD()"

我建议强制每个人创建一个新密码,通过电子邮件和随 secret 钥进行验证,然后使用良好的方法存储新密码(使用 PHPass 或至少使用 salt 的 bcrypt)。

关于php - MYSQL 4 密码哈希 -> MYSQL 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17055531/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com