mysql5.5 多实例找回密码

1.关闭mysql


 killall mysqld


2.启动时加--skip-grant-tables 参数


mysqld_safe --defaults-file=/data/3306/my.cnf --skip-grant-table &


3.登录


mysql -uroot -p -S /data/3306/mysql.sock (登录时空密码)

 

4.修改密码:


update mysql.user set password=password('newpassword') where user='root' and host='localhost';
flush privileges;

posted @ 2017-04-27 23:23  shijiu520  阅读(189)  评论(0)    收藏  举报