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

Steps for mysql to reset root password

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

Share

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

Today, the editor shares with you the steps for mysql to reset the root password. I believe many people do not know much about it. In order to let you know more about the steps for mysql to reset the root password, I have summarized the following contents for you. Let's look down together. I'm sure you'll get something.

How to reset the root password by mysql

1. Shut down the MySQL server:

Service mysql stop

2. Enter the directory and start MySQL in safe mode

Cd / usr/local/mysql/bin. / mysqld_safe-- skip-grant-tables &

Note:

Maybe your system does not have a safe_mysqld program (Windows or Ubuntu operating system), you can use mysqld:

Mysqld-- skip-grant-tables &

3. After startup, the root user logs in to mysql with an empty password:

# mysql-u rootmysql > update mysql.user set password=PASSWORD ('123456') where User='root'; # change password mysql > flush privileges; # refresh permission mysql > quit

4. Start MySQL:

Service mysql start

It is possible to log in with the new password 123456.

If you know the password, you can use the following command:

# mysqladmin-u root-p password New password

The above is a brief introduction of the steps for mysql to reset the root password. Of course, the differences in the detailed use of the above have to be understood only after you have used them. If you want to know more, 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