# 停止 mysql 服务

# 修改 mysql 配置文件 /etc/my.cnf,添加如下信息

[mysqld]
skip-grant-tables

 

# 重新启动 mysql 服务

 

# 免密登录
mysql -uroot
use mysql;
update user set password = password('123456'), authentication_string = password('123456') where user = 'root';
flush privileges;

 

# 停止 mysql 服务后,还原 /etc/my.cnf 配置文件后重启服务后,使用新密码登录即可

 

相关文章:

  • 2021-11-27
  • 2021-06-08
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2021-08-17
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2021-10-09
  • 2022-12-23
  • 2021-08-08
  • 2021-09-27
  • 2021-11-07
  • 2021-05-23
相关资源
相似解决方案