您的位置:首页 > 数据库 > MySQL

mysql root用户密码丢失解决方法

2013-05-30 20:08 267 查看
1.停止mysql服务:

net stop mysql;

2.使用--skip-grant-tables启动mysql服务,使其停止权限判断:

mysqld --skip-grant-tables;

或 mysqld-nt --skip-grant-tables;

或 net start mysql --skip-grant-tables;

3.用root用户登录(不需要密码),并设置新密码:

mysql -u root

UPDATE mysql.user SET Password=Password(‘new_password') where User='root' AND Host='localhost';

4.加载权限表:

flush privileges;

结束!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  MySQL 密码