1 先停止掉 mysql 服务
/etc/init.d/mysqld stop
2 使用 mysqld_safe 安全登录
mysqld_safe --skip-grant-tables &
3 执行登录,修改密码等
mysql -u -rootuse mysql;update user set password=password('your new password') where user='root';exit;
4 重新启动mysql服务
/etc/init.d/mysqld start
bitscn.com
