赞
踩
CREATE USER 'jkhuser1'@'%' IDENTIFIED BY 'password'; CREATE USER 'jkhuser2'@'%' IDENTIFIED BY 'password'; 给jkhUser1授予指定数据库的查询操作 GRANT SELECT ON `数据库名`.* TO 'user1'@'%'; 给jkhUser2授予指定数据库的查询、新增、修改、删除操作 GRANT SELECT, INSERT, UPDATE,DELETE ON `数据库名`.* TO 'user2'@'%'; 设置用户密码过期时间 alter user 'user1'@'%' password expire interval 90 day; alter user 'user2'@'%' password expire interval 90 day; 查看密码过期设置 select user,host,password_expired ,password_last_changed ,password_lifetime from user;
密码过期提示:
错误详情:Your password has expired. To log in you must change it using a client that supports expir
解决: 1、在my.cnf中添加 [mysqld] skip-grant-tables 2、重启msyql 3、不使用密码进入mysql设置mysql密码永不过期 mysql -uroot update user set password_expired=‘N’ where user=‘root’; flush privileges; quit; 4、注释my.cnf中 [mysqld] skip-grant-tables 5、重启mysql 6、登录账户
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。