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

MySQL password expiration problem

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Sometimes when you log in to MySQL, you will be prompted for password expiration, as shown below:

At this time, the client window cannot log in to the MySQL database server, but you can log in to the MySQL database server through the command line operation, but log in to the MysQL database server through the command line and cannot execute any commands. You need to change the mysql password at this time, as shown below:

Enter MySQL from the command line

Mysql-uroot-pwf123456

Execute the command to change the password:

SET PASSWORD = PASSWORD ('123456')

Note: when you use this command "set password for root@localhost = password ('wf123456');" when you change the password, you will be prompted for an error with the error code "You must reset your password using ALTER USER statement before executing this statement." So change the password and use the above command as much as possible.

Set no expiration time for the database account:

ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER

Check to see if the password_expired field in the user's user table is Y, Y, and the user has expired, N, then the user has not expired.

After changing the password of the account, MySQL's client connection tool can reconnect to the database.

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