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

Simple settings for resetting mysql root passwords

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

Share

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

Let me tell you a little bit about the simple setting of resetting your mysql root password. Have you learned about similar topics before? If you are interested, let's take a look at this article. I believe that the simple setting of resetting your mysql root password will be of some help to you.

The method to change the password when the ROOT user password of the MYSQL database is known:

1. In SHELL environment, use the mysqladmin command to set: mysqladmin-u root-p password "new password". Enter the old password after entering.

2. In the mysql > environment, use the update command to directly update the data of the user table of the mysql library:

Update mysql.user set password=password ('new password') where user='root'

Flush privileges

Note: the mysql statement ends with a semicolon ";"

3. In the mysql > environment, use the grant command to modify the authorization permissions of the root user.

Grant all on *. * to root@'localhost' identified by 'new password'

What if I forget the password of the ROOT user in the mysql database? The methods are as follows:

1. Close the currently running mysqld service program: service mysqld stop (to add mysqld as a system service first)

2. Use the mysqld_safe script to start the mysqld service in safe mode (without loading the authorization table)

/ usr/local/mysql/bin/mysqld_safe-skip-grant-table &

3. Log in to the database with a root user with an empty password and reset the password of the ROOT user

# mysql-u root

Mysql > Update mysql.user set password=password ('new password') where user='root'

Mysql > flush privileges

What do you think of this article about the simple setting of the mysql root password, and whether it has gained anything? If you want to know more about it, you can continue to follow our industry information section.

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