ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this
mysql下载地址:https://dev.mysql.com/downloads/mysql/
网上有许多安装教程,这里就不演示了,只是解决安装时遇到的问题。
2020-07-18T06:31:46.899220Z 0 [Warning] CA certificate ca.pem is self signed.
2020-07-18T06:31:48.250498Z 1 [Note] A temporary password is generated for root@localhost: ****fyw;=8nsVj=F****
上面是它自动为我们分配的密码fyw;=8nsVj=F
进入mysql后使用use mysql;
就会报You must reset your password using ALTER USER statement b,改密码:
update mysql.user set authentication_string=password(’****’) where user=‘root’ and Host =‘localhost’; 同样会报错。
解决方案:
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘root’ PASSWORD EXPIRE NEVER;
用这个方法设置密码。
flush privileges;