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

Example Analysis of root initial password setting in percona 5.7.11

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

Share

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

This article mainly introduces the example analysis of root initial password setting in percona 5.7.11, which is very detailed and has certain reference value. Interested friends must read it!

After installing percona5.7.11 for the first time, there is a problem that root users need to enter a password when they log in to the database (this is the security mechanism of 5.7root account)

Someone on the Internet said that there was a default password for the root account in the / root/.mysql_secret file, but I didn't find the file, so I had to crack it violently.

1. Modify the / etc/my.cnf file, add skip-grant-tables under [mysqld] and restart

Login:

[root@trcloud-gtt-dw] # mysql-uroot-p

Enter password:

Enter directly from here.

2. Modify data field information

Mysql > update mysql.user set authentication_string=password ('123456') where user='root'; (the password field before 5.7has been changed to authentication_string)

Mysql > flush privileges

3. Delete the skip-grant-tables in the / etc/my.cnf file and restart

Login:

[root@trcloud-gtt-dw] # mysql-uroot-p

Enter password: (enter the password you just set)

Reset the password after the first login to operate the database

Mysql > set password=password ('123456')

Note: in addition to modifying the / etc/my.cnf file, you can also close the data and use mysqld_safe-- skip-grant-tables & mysql-uroot-p to enter the database to change the root password. The principle of the two methods is the same, but the operation mode is different.

The above is all the contents of the article "sample Analysis of root initial password setting in percona 5.7.11". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to 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