mysql8的坑,修改root用户的密码类型就行了

ALTER USER 'root'@'localhost' IDENTIFIED with mysql_native_password BY 'root' PASSWORD EXPIRE NEVER;
flush privileges;