• password failed validation. The password for the user is too recent to change.


    Issue

    受制于公司策略,密码必须要有过期时间,但如果时间到了用户就可能会被锁,定时通知修改又很麻烦,所以想使用脚本定时修改为旧密码。但单独使用下面的语句修改sql用户的密码就会报错。

    alter login [test] with password=N'1234' old_password=N'1234'
    -- 错误: password failed validation. The password for the user is too recent to change.
    

    Solution

    可以迂回一下

    alter login [test] with check_policy=off ,check_expiration=off;
    alter login [test] with password=N'1234' old_password=N'1234';
    alter login [test] with check_policy=on ,check_expiration=on;
    
  • 相关阅读:
    1434. Buses in Vasyuki 夜
    SAP
    目标
    组合数
    KM算法模板
    网络流
    CodeForces 43E
    B. Unsorting Array codeforces 127
    Colorful Rainbows 127
    C. Anagram codeforces
  • 原文地址:https://www.cnblogs.com/ls11736/p/16067231.html
Copyright © 2020-2023  润新知