dorbmd1177 2019-06-10 13:25 采纳率: 100%
浏览 389

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

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

  • 写回答

1条回答 默认 最新

  • dongpang4470 2019-06-10 19:47
    关注
    UPDATE :table SET password = ENCRYPT(':newpass', CONCAT('$6$', SUBSTRING(SHA(RAND()), -16))) WHERE email = ':email'
    

    ... i was missint the '' around :email :sigh:

    评论

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line