Mysql忘记密码

作者:hack1990 时间:15-12-12 阅读数:653人阅读

虽然和mysql打交道这么长时间,以前也忘记过密码,不过要在linux下命令操作,还是有些生疏,于是翻了翻资料,记录下来




1.停止mysql


service mysql stop



2.设置跳过验证


mysqld_safe --skip-grant-tables



3.再开个终端


root@linux: mysql


mysql > use mysql;


mysql > updata user set password=password('yourpassword') where user='root';


mysql > flush privileges;


mysql > exit;





ps:不打分号sql语句是不会执行成功了


评论列表

  •  
    xio
    发布于 2017-12-25 23:26:25  回复
  • 199df95c5af506ae4615de20533f689f可以用吗。

发表评论