MySQL密码过期该怎么办

56次阅读
没有评论

共计 980 个字符,预计需要花费 3 分钟才能阅读完成。

这篇文章给大家介绍 MySQL 密码过期该怎么办,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

1、报错提示
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords;
2、解决方法
 (1)停止 MySQL 数据库
 (2)以忽略密码方式启动 mysql 数据库,并进入数据库;
        在 my.cnf 文件中的[mysqld] 添加 skip-grant-tables 参数
   (3)进入 MySQL 的中的 mysql 库(该命令为多实例进入命令)
  [root@host1 data4]# mysql -S /tmp/mysql.sock2
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.16-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

mysql  
(4)讲 password_expired 设置为永不过期,
 mysql update user set password_expired= N where user= root
Query OK, 1 row affected (5.06 sec)
Rows matched: 1  Changed: 1  Warnings: 0
(5)退出后,关闭 MySQL 并注销 my.cnf 中的 skip-grant-tables 参数
进入 mysql 数据库后重新配置密码;

关于 MySQL 密码过期该怎么办就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-19发表,共计980字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)