You must reset your password using ALTER USER statement before executing thi

新电脑安装mysql5.7通过client连接mysql想要修改密码:
一开始执行的是

update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';

然后报错:

在这里插入图片描述
原来一开始是没有密码的,在初始化的时候有个密码,只是相当于临时密码:
直接执行设置密码即可:

alter user user() identified by "root";

然后通过工具就可以直接连接了…

posted @ 2019-09-11 15:10  你就像甜甜的益达  阅读(635)  评论(0编辑  收藏  举报