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

Change the password record of root users in mysql5.7 and below under linux

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

Share

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

1. Mysql 5.7 change password record:

After applying for the Aliyun account, it comes with the mysql database, but mysql-u root-p cannot log in directly, so change the password and record as follows:

1) vi / etc/my.cnf 2) add: skip-grant-tables somewhere under [mysqld], then: wq save exit 3) execute the command under / usr/local/mysql/bin directory:. / mysql-u root-p, then enter mysql4 twice and execute the command: use mysqlSET SQL_SAFE_UPDATES = 05) update mysql.user set authentication_string=password ('root') exit) flush privileges 7) execute the command: SET SQL_SAFE_UPDATES = 18) vi / etc/my.cnf, delete skip-grant-tables line 9) service mysqld restart10) execute the command in the / usr/local/mysql/bin directory:. / mysql-u root-p and enter the new password: root to enter mysql

2. Change the password in mysql version 5.6:

It is relatively easy to change passwords in the following versions of mysql5.7

1) after installation and configuration, execute the following command to enter mysql

Mysql-u root-p, enter mysql twice

2) change the password: update user set password=password ('root') where User='root'

3) flush privileges

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