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

What if I forget my mysql password?

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

Share

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

1. Stop the mysql service

[root@db02 data] # / etc/init.d/mysqld stopShutting down MySQL.. SUCCESS!

two。 Start mysql with-- skip-grant-tables, ignoring authorization login verification

[root@db02 data] # mysqld_safe-- skip-grant-tables-- user=mysql > / dev/null 2 > & 1 & [1] 30246

3. Log in to mysql and fix the root password

[root@db02 data] # mysql mysql > UPDATEmysql.user SET password=PASSWORD ("123") WHERE user='root' andhost='localhost';Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql > flush privileges;Query OK, 0 rows affected (0.01 sec) mysql > quitBye

4. Exit mysql and restart mysql

[root@db02 data] # / etc/init.d/mysqld stopShutting down MySQL.. SUCCESS! [1] + Done mysqld_safe-skip-grant-tables-user=mysql > / dev/null 2 > & 1 [root@db02 data] # / etc/init.d/mysqld startStarting MySQL. SUCCESS!

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