进入mysql数据库,修改数据库的内容

 1, use mysql;

2,update user set authentication_string=""  where User='root';//设 authentication_string 为空值 ,因为是连接这个加密的东西

先设密码为空

3,update user set plugin="mysql_native_password";

4,flush privileges;

5,quit;

然后重启MySQL。

6,接着在命令行修改root用户密码,

     mysqladmin -u root -p password

按提示重设密码

ok。完美连接成功

 --------------------------------------------------------分割线-----------------------------------------

以上mysqladmin 是window系统有的,Linux用不上,在MySQL5.7以上的版本,mysql的user表的密码是authentication_string,不再是password

linux更改root密码:update user set authentication_string=password("test") where User='root';//那个password 是必须要写的,不然就进不去了数据库。

flush privileges;

相关文章:

  • 2022-01-12
  • 2021-07-25
  • 2021-12-11
  • 2022-01-01
  • 2021-12-15
  • 2021-12-18
  • 2021-07-05
猜你喜欢
  • 2021-07-13
  • 2021-10-21
  • 2021-07-24
  • 2021-06-27
  • 2022-12-23
相关资源
相似解决方案