ITeye博客

mysql 忘记root密码解决方法

不念书的小子 · 2010-08-04 10:46 · MySql · 数据库 · MySQL · 不念书的小子 · mysql 忘记root密码解决方法 · Markdown

2. 用以下命令启动MySQL,以不检查权限的方式启动;
mysqld --skip-grant-tables

3. 然后用空密码方式使用root用户登录 MySQL;
mysql -u root
4. 修改root用户的密码;
mysql> update mysql.user set password=PASSWORD('newpassword') where User='root';
mysql> flush privileges;
mysql> quit

评论(1)

  1. #1 楼 · asialee · 2010-08-04 16:23

    不错,我什么时候试试

评论功能维护中,当前仅展示历史评论。