手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL 5.6锁定用户

[日期:2016-07-21] 来源:Linux社区  作者:gaopengtttt [字体:大 中 小]

MySQL 5.7加入了LOCK ACCOUNT功能和Oracle一样了,但是MySQL 5.6貌似没有,但是可以代替用如下方法设置密码过期。

The mysql.usertable now has a password_expiredcolumn. Its default value is 'N', but

can be set to 'Y'with the new ALTER USER statement. After an account's password has been

expired, all operations performed in subsequent connections to the server using the account result

in an error until the user issues a SET PASSWORDstatement to establish a new account password.

For more information, see Section 13.7.1.1, “ALTER USERSyntax”, and Section 6.3.6, “Password

Expiration and Sandbox Mode”.

就是下面这个语法

mysql> alter user mytest1@'%' password expire;

如果要恢复

set password for mytest1@'%' = '*******';

其实就是MYSQL.USER下面的字段 password_expired 标示了是否过期。

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-07/133394.htm

linux
相关资讯       MySQL锁定用户 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款