mysql 多实例密码破解

来源:本站原创 Linux 超过4 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.登录修改密码
[root@shjhmysql02 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.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=3576转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点