Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the mysql5.7 password expires?

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The following mainly brings you mysql5.7 password expired how to do, I hope these words can bring you practical use, this is also my edit mysql5.7 password expired how to do the main purpose of this article. All right, don't talk too much nonsense, let's just read the following.

Error report:

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

Translation:

Error 1862 (HY000): your password has expired. Login must be changed to use a client that supports expired passwords.

Solution:

1. Enter mysql by ignoring the authorization table

Vi / etc/my.cnf

[mysqld]

Skip-grant-tables

: wq! # Save exit

2. Enter mysql to view the details of root users.

# mysql-u root-p

Use mysql

Select * from mysql.user where user='root'\ G

* * 1. Row *

Host: localhost

User: root

Select_priv: Y

Insert_priv: Y

Update_priv: Y

Delete_priv: Y

Create_priv: Y

Drop_priv: Y

Reload_priv: Y

Shutdown_priv: Y

Process_priv: Y

File_priv: Y

Grant_priv: Y

References_priv: Y

Index_priv: Y

Alter_priv: Y

Show_db_priv: Y

Super_priv: Y

Create_tmp_table_priv: Y

Lock_tables_priv: Y

Execute_priv: Y

Repl_slave_priv: Y

Repl_client_priv: Y

Create_view_priv: Y

Show_view_priv: Y

Create_routine_priv: Y

Alter_routine_priv: Y

Create_user_priv: Y

Event_priv: Y

Trigger_priv: Y

Create_tablespace_priv: Y

Ssl_type:

Ssl_cipher:

X509_issuer:

X509_subject:

Max_questions: 0

Max_updates: 0

Max_connections: 0

Max_user_connections: 0

Plugin: mysql_native_password

Authentication_string: * AC241830FFDDC8943AB31CBD47D758E79F7953EA

Password_expired: N

Password_last_changed: 2015-11-11 16:52:49

Password_lifetime: NULL

Account_locked: N

1 row in set (0.00 sec)

3. Change the password_expired to not expire

Update user set password_expired='N' where user='root'

> flush privileges

> quit

Comment out the skip-grant-tables line of / etc/my.cnf

5. Restart the service

# service mysql restart

6. Log in to mysql again and it will be normal

For the above about what to do when the mysql5.7 password expires, do you think it is very helpful? If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report