Mysql 8 默认采用新的密码认证方式 caching_sha2_password ,
如果想使用8以前的认证方式 mysql_native_password, 做如下配置
my.cnf
1
2[mysqld]
default_authentication_plugin=mysql_native_password修改密码
1
2mysql>
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$password';