简体   繁体   中英

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. 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

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''电子邮件:叹息:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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