mysql5.7.24啟動報錯:ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.


報錯原因是:密碼過期。不管你是剛剛修改密碼還是什么,只要登陸都是有問題的,都是報這樣子的錯誤。

解決方法是:

1、修改/etc/my.cnf文件,在[mysqld]下加入“skip-grant-tables”。

2、重啟mysql服務器

3、登陸mysql

[root@:vg_adn_tidbCkhsTest /usr/local/src]#mysql -u root -p                   #此處直接按下enter鍵即可
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MySQL [(none)]> update mysql.user set password_expired='N' where user='root'
    -> ;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MySQL [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MySQL [(none)]> exit

4、修改/etc/my.cnf。把“skip”這一行內容注釋掉

5、再次重啟mysql服務器即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM