ITPub博客

首页 > 数据库 > MySQL > MySQL密码过期

MySQL密码过期

原创 MySQL 作者:1006356403 时间:2017-03-07 17:14:22 0 删除 编辑
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数据库后重新配置密码;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30317998/viewspace-2134873/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
精通Oracle,mysql等常用数据库.精通Oracle主从架构,ogg同步复制,集群操作等.mysql主备复制,双活架构配置,数据库优化等

注册时间:2015-06-30

  • 博文量
    43
  • 访问量
    47609