Mysql root密码丢失

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即可 

你可能感兴趣的:(mysql)