ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

(编辑:jimmy 日期: 2024/11/13 浏览:2)

错误信息:

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords

出现问题原因:

可能是你在安装 MySQL过程中,通过mysqld --initialize 初始化 mysql 操作后,生成临时密码后,没有直接进行 MySQL连接,中途重启服务或者重启机器等,导致密码失效问题

解决方式:

1.修改 my.cnf 配置文件

vi /etc/my.cnf

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

2.重启 mysql 服务

你可以使用 service mysqld restart 重启也行,因为我是通过二进制源码包安装的 MySQL,这种方式启动目前报错。所以我是用安装目录下的 support-files 目录下的命令重启,如下图所示

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

3.无密码登录

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

4.同第 1 步,将新增的 skip-grant-tables =1 删除

5.同第 1 步,重启 mysql 服务

6.使用新密码 root 来登录 mysql

ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....

好了,本文结束,希望对大家有所帮助!