sudo mysqld_safe --skip-grant-tables &
)。,3. 登录mysql(无需密码):mysql -u root
。,4. 选择mysql数据库:use mysql;
。,5. 更新root用户的密码(假设新密码为newpassword): update user set authentication_string=password('newpassword') where user='root';
。,6. 刷新权限:flush privileges;
。,7. 退出mysql:exit;
。,8. 正常重启mysql服务。Powered By Z-BlogPHP 1.7.3