站长网 MySql教程 MySQL密码过期当怎么办

MySQL密码过期当怎么办

这篇文章给大家介绍MySQL密码过期该怎么办,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。 1、报错提示 ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passw

这篇文章给大家介绍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密码过期该怎么办就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

本文来自网络,不代表站长网立场,转载请注明出处:https://www.tzzz.com.cn/html/jc/mysql/2021/1218/40481.html

作者: dawei

【声明】:站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。
联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部