MySQL密码过期该怎么办

发布时间:2021-11-16 14:27:27 作者:柒染
来源:亿速云 阅读:935

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

推荐阅读:
  1. mysql5.7 密码过期了怎么办
  2. orale用户密码过期处理

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql

上一篇:怎么理解Java语言的编译期

下一篇:怎么创建的docker镜像u-stress进行压力测试

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》