共計 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 密碼過期該怎么辦就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。