我们可以采用类似安全模式的方法修改初始密码

先执行命令  mysqld_safe --skip-grant-tables &   (设置成安全模式)

&,表示在后台运行,不再后台运行的话,就再打开一个终端咯。

# mysql

mysql> use mysql;

mysql> update user set authentication_string=password('111111') where user='root' ; (会提示修改成功query ok)

mysql> flush privileges;

mysql> exit;

相关文章:

  • 2022-12-23
  • 2021-12-20
  • 2022-02-23
  • 2021-12-05
  • 2022-02-04
  • 2022-01-21
  • 2021-06-03
  • 2021-12-27
猜你喜欢
  • 2021-12-20
  • 2021-11-20
  • 2022-01-13
  • 2021-05-03
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
相关资源
相似解决方案