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 retrieve the root password of mysql database in linux system

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

Share

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

Mysql forgets root password under linux

1. Shut down mysql service

Service mysqld stop

Second, modify the mysql configuration file

Modify / etc/my.cnf and add it under the [mysqld] module

Skip-grant-tables # # ignore the mysql permission problem and log in directly

After modification

Start the mysql service and log in to the mysql database directly

You don't need a password to log in to the mysql database at this time. You can log in directly.

Service mysqld start;mysql-u root-p

Change the root password

Mysql > update mysql.user set password=PASSWORD ('new_password') where User='root'; mysql > flush privileges; mysql > quit

Change my.cnf back, and then restart the mysql service

Service mysqld restart

VI. Completion

Just log in with the new password.

What if I forget the root password of the mysql database under linux? For more details, please pay attention to other related articles!

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