mysql 多實例密碼破解

來源:本站原創 Linux 超過495 views圍觀 0條評論

適用于環境的

1.停止相應實例

/usr/bin/mysqld_multi –defaults-extra-file=/etc/mysql/cfg3309.cnf –log=/var/log/mysql/mysql_3309.log stop

2.修改相應實例配置文件

[mysqld3309]
skip-grant-tables  #增加一條跳過權限檢測
"/etc/mysql/cfg3309.cnf" 39L, 1682C

3.開啟實例

4.登錄修改密碼
[[email protected] tmp]# mysql -S /tmp/mysql3309.sock
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> update mysql.user set password = password("我是密碼") where user = ‘root’ and host = ‘localhost’;

5.還原配置
6.重啟

網上找的 實際沒掉用

killall mysqld
mysqld_safe –default-file=/data/3306/my.cnf –skip-grant-table &    –skip-grant-table放置在后面
mysql -uroot -p -S /data/3306/mysql.sock 登錄密碼為空
修改密碼 update mysql.user set password = password("123456") where user = ‘root’ and host = ‘localhost’;
flush privileges;

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=3576轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
?
?
萌宠夺宝游戏