简体   繁体   English

更新MySQL数据库中的加密密码

[英]update encrypted password in MySQL database

I have installed this addon: https://github.com/RainLoop/rainloop-webmail/tree/master/plugins/change-password-custom-sql into rainloop webmail. 我已经安装了这个插件: https//github.com/RainLoop/rainloop-webmail/tree/master/plugins/change-password-custom-sql到rainloop webmail。 I am trying to get so that users can update their passwords themselves. 我试图让用户可以自己更新他们的密码。 When i deployed the webmail, mysql etc i followed this tutorial: https://www.cyberpunk.rs/mail-server-setup-postfix 当我部署webmail,mysql等我遵循本教程: https//www.cyberpunk.rs/mail-server-setup-postfix

When adding users i use: 添加用户时我使用:

INSERT INTO `EMAIL_DB`.`virtual_users`
(`id`, `domain_id`, `password` , `email`)
 VALUES
 ('1', '1', ENCRYPT('password for the user', CONCAT('$6$', 
SUBSTRING(SHA(RAND()), -16))), 'email@domain.com');

So when i try to configure the addon i use this as my query: 因此,当我尝试配置插件时,我将其用作我的查询:

UPDATE :table SET password = ENCRYPT(':newpass', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) WHERE email = :email

But i cant seem to get it to work 但我似乎无法让它工作

UPDATE :table SET password = ENCRYPT(':newpass', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) WHERE email = :email

I get no other error message except that password cant be updated... 我没有得到任何其他错误消息,除了密码不能更新...

UPDATE :table SET password = ENCRYPT(':newpass', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) WHERE email = ':email'

...我是'miss around''电子邮件:叹息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM