忘记了 MySQL 的 root 密码
2007-03-09 17:54
453 查看
如果忘记了 MySQL 的 root 密码,可以用以下方法重新设置:
1. KILL掉系统里的MySQL进程;
2. 用以下命令启动MySQL,以不检查权限的方式启动;
mysqld_safe --skip-grant-tables &
3. 然后用空密码方式使用root用户登录 MySQL;
mysql -u root
4. 修改root用户的密码;
mysql> update mysql.user set password=PASSWORD('新密码') where User='root';
mysql> flush privileges;
mysql> quit
(例如:更改root 密码为 123456
# mysql mysql
mysql> update user set password=password(/'123456/') where user=/'root/'; //password(...)是函数
mysql> flush privileges;
mysql> exit)
5. 重新启动MySQL,就可以使用新密码登录了。
1. KILL掉系统里的MySQL进程;
2. 用以下命令启动MySQL,以不检查权限的方式启动;
mysqld_safe --skip-grant-tables &
3. 然后用空密码方式使用root用户登录 MySQL;
mysql -u root
4. 修改root用户的密码;
mysql> update mysql.user set password=PASSWORD('新密码') where User='root';
mysql> flush privileges;
mysql> quit
(例如:更改root 密码为 123456
# mysql mysql
mysql> update user set password=password(/'123456/') where user=/'root/'; //password(...)是函数
mysql> flush privileges;
mysql> exit)
5. 重新启动MySQL,就可以使用新密码登录了。
相关文章推荐
- linux下mysql忘记root密码的解决方案
- linux mysql 忘记root密码
- linux下mysql的root密码忘记了解决方案
- windows下Mysql忘记root密码
- mysql忘记root密码拯救方法(flush privileges)
- MySql5.5忘记root密码的解决办法
- windows下mysql忘记root密码的解决方法
- MySQL忘记root密码
- Linux下MySQL忘记root密码 1.2
- mysql忘记root密码该怎么办
- MySQL,如何修改root帐户密码、如何解决root帐户忘记密码的问题
- mysql忘记root密码连接本地库
- 忘记MySql的root密码如何修改
- windows 7 下 MySQL 5.5 的root密码忘记了,解决办法。
- linux下mysql的root密码忘记解决方
- linux下mysql的root密码忘记解决方
- 在Linux环境下mysql的root密码忘记解决方法
- windows下忘记mysql超级管理员root密码的解决办法
- windows 下忘记mysql-root密码的更改
- mysql忘记root密码的解决方法