linux 重置MySQLroot密码

  1. 修改MySQL的配置文件(默认为/etc/my.cnf),在[mysqld]下添加一行 skip-grant-tables
  2. 保存配置文件后,重启MySQL服务 service mysqld restart
  3. 再次进入MySQL命令行 mysql -uroot -p,输入密码时直接回车,就会进入MySQL数据库了,这个时候按照常规流程修改root密码即可。
  4. update user set password = password(‘PeKJ3qmRsBcexSBa’) where User = ‘root’;
  5. 重启MySQL服务,新密码就生效了。
  6. 打完收工!

1 thought on “linux 重置MySQLroot密码

  1. Jamesaduck说道:

    No matter how you do it, losing weight is an individual thing. Friends can help you but they can’t lose the weight for you. You’ve got to take charge of your weight loss from the beginning if you want to get serious about losing weight. The following tips will help.

发表评论

电子邮件地址不会被公开。 必填项已用*标注