Mysql忘记密码
虽然和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语句是不会执行成功了