mysql8.0版本设置密码无效的问题
版本为8.0.28-0ubuntu0.20.04.3 (Ubuntu)
使用 identified by 设置无效
改用下面的方式
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
flush privileges;
之后
select Host, User, authentication_string from user;
可以看到root那一行的 authentication_string不为空即可