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

Introduction of Mysql password reset method

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

Share

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

This article mainly introduces the Mysql password reset method, the content of the article is carefully selected and edited by the author, with a certain pertinence, for everyone's reference significance is still relatively great, the following with the author to understand the Mysql password reset method.

Step # 1: Stop the MySQL server process.Step # 2: Start the MySQL (mysqld) server/daemon process with the-skip-grant-tables option so that it will not prompt for password.Step # 3: Connect to mysql server as the root user.Step # 4: Setup new mysql root account password i.e. Reset mysql password.Step # 5: Exit and restart the MySQL server.

Ok, five steps, go!

Step # 1: stop the sql service

/ etc/init.d/mysql stop

Output Stopping MySQL database server: mysqld.

Step # 2: start the mysql service image

Mysqld_safe-- skip-grant-tables &

Output

Starting mysqld daemon with databases from / var/lib/mysql

Mysqld_safe

Step # 3: link a database as a mysql service

Mysql-u root

Output display

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

Type 'help;' or'\ h' for help. Type'\ c'to clear the buffer.

Mysql >

Step # 4: set a new password for root users mysql > use mysql;mysql > update user set password=PASSWORD ("your password") where User='root';mysql > flush privileges;mysql > quitStep # 5: start the mysql service

/ etc/init.d/mysql stop

Stopping MySQL database server: mysqld

STOPPING server from pid file / var/run/mysqld/mysqld.pid

Mysqld_safe [6186]: ended

[1] + Done mysqld_safe-- skip-grant-tables

Step # 6: verify / etc/init.d/mysql start mysql-u root-p

Enter this command, press enter and then enter the password, you can enter the database!

Reference:

Https://www.cyberciti.biz/tips/recover-mysql-root-password.html

After reading the above about Mysql password reset method, many readers must have some understanding, if you need to get more industry knowledge and information, you can continue to follow our industry information column.

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

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report