killall -9 mysqld 
或者 /etc/inint.d/mysqld stop 
usr/local/mysql/bin/mysqld_safe --skip-grant-table&
/usr/local/mysql/bin/mysql -u root
use mysql
UPDATE user SET password=password('ABC') WHERE user='root'; 
FLUSH PRIVILEGES; 
service mysqld restart

 

 

如果还有其它用户能登录,可以执行 

use mysql

UPDATE user SET password=password('ABC') WHERE user='root';  

然后重启mysql即可 

posted on   凌度  阅读(224)  评论(0编辑  收藏  举报
努力加载评论中...

点击右上角即可分享
微信分享提示