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? MySQL reset root password method

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

Share

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

Solution to the loss of Mysql password in a single instance

# ps-ef | grep 330 instances view the PID# kill PID# kill PID# mysqld_safe of 3306 instances-- skip-grant-table & # > update mysql.user set password=PASSWORD ("123456") where user='root' and host='localhost';# > flush privileges;# ps-ef | grep 330 instances kill PID# mysqld_safe is still running in the background. You need kill to restart the mysql service # / etc/init.d/mysqld start# mysql-uroot-p123456Welcome to the MySQL monitor. Commands end with; or\ g. MySQL >

2. Solution to the loss of multi-instance Mysql password

# ps-ef | grep 330 kill PID # mysqld_safe-- defaults-file=/data/3308/my.cnf-- skip-grant-table 2 > & 1 > / dev/null & # mysql-S / data/3308/mysql.sock > update mysql.user set password=PASSWORD ("0818") where user='root' and host='localhost'; > flush privileges; > quit# ps-ef | grep 330 kill pid# / data/3308/mysql start# mysql-uroot-p0818-S / data/3308/mysql.sock Welcome to the MySQL monitor. Commands end with; or\ g.mysql >

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