richardnull

1. 检查mysql服务是否启动,如果启动,关闭mysql服务

   如果开启就关闭服务

2.修改mysql的配置文件my.conf

    一般在/etc目录下,运行命令:vi /etc/my.cnf,编辑文件

    在文件的[mysqld]标签下添加一句:skip-grant-tables

 

保存之后

3.重启数据库

4.登录数据库之后

运行语句:use mysql;
继续运行语句:update mysql.user set authentication_string=password(\'root_password\') where user=\'root\';
root_password替换成你想要的密码


 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-10-09
  • 2022-12-23
  • 2021-08-22
  • 2021-08-03
  • 2021-09-27
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-11-28
  • 2022-02-18
  • 2021-08-02
  • 2021-09-02
  • 2021-06-24
相关资源
相似解决方案