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

MYSQL password recovery for single instance and multi-instance

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

Share

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

1. In the MYSQL database of a single instance:

Killall mysqld

Mysqld_safe-- skip-grant-tables &

Mysql

Update mysql.user set password=password ("123456") where user='root' and host='localhost'

Flush privileges

Quit

Mysqladmin-uroot-p123456 shutdown

/ etc/init.d/mysql start

Success!

2. In a multi-instance MYSQL database:

Killall mysqld

Vi / data/3306/my.cnf

Add: skip-grant-tables under [mysqld]

/ data/3306/mysql start

Mysql-S / data/3306/mysql.sock

Update mysql.user set password=password ("123456") where user='root' and host='localhost'

Flush privileges

Quit

/ data/3306/mysql stop

Remove the skip-grant-tables under [mysqld] in / data/3306/my.cnf

/ data/3306/mysql start

Mysql-uroot-p123456-S / data/3306/mysql.sock

Success!

Reference: http://blog.csdn.net/czz1141979570/article/details/78568080

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