密码过期错误信息如下:
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.
// 错误1862 (HY000):您的密码已过期, 要登录,您必须使用支持过期密码的客户端进行更改
1.用忽略授权表的方法进入mysql(忘记密码用此方法进入)
- vi /etc/my.cnf
[mysqld]
skip-grant-tables
mysql -u root -p
2.进入mysql,查看root用户的详细信息
- use mysql
- select * from mysql.user where user='root' \G;
按列显示数据
3.把password_expired改成不过期
- update user set password_expired='N' where user='root';
- flush privileges;
- quit
4.把skip-grant-tables这行注释掉
- vi /etc/my.cnf
[mysqld]
#skip-grant-tables
5.重启MySql服务, 再次登陆就可以了