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

How to forget the mysql password in linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What this article shares to you is about how to forget the mysql password in the linux system. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

The problem is as follows: enter the command mysql-uroot-p, but forget the password.

Step 1: stop the mysql service

There is a way to open / etc/my.cnf online and modify it, but I didn't find the file in this directory at all. Maybe the reason for the version!

Enter the command to stop the mysql service: / etc/init.d/mysql stop

Step 2: start mysql safely and skip the authorization table: mysqld_safe-- user=mysql-- skip-grant-tables-- skip-networking &

Step 3: reset the mysql password

Enter: mysql-uroot-p, you don't need to enter the password at this time, just press enter to enter.

Input statement: use mysql, that is, select a database and enter the statement to reset the password. I found the following problem, which means that the password column is not in it.

So what should be changed is the authentication_string column.

After that, enter the command: flush privileges, which is used to refresh the system permission related table of mysql. Quit exits mysql

Step 4: restart the service and enter the newly set password to log in

Restart the mysql service: / etc/init.d/mysql restart

Enter the password and enter mysql.

The above is how to forget the mysql password in the linux system. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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