使用原有工具连接MySQL会出现连不上的问题,原因在于8.0已更改安全认证方式,原有工具还没有跟上导致。
创建用户并授权
root@yq 16:08: [mysql]> create user 'yqtest'@'%' identified by '123456';
Query OK, 0 rows affected (0.01 sec)
root@yq 16:10: [mysql]> grant all privileges on ytest.* to 'yqtest'@'%';
Query OK, 0 rows affected (0.01 sec)
# 查看加密方式
root@yq 16:11: [mysql]> select user,host,plugin from mysql.user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| yq | % | mysql_native_password |
| yqtest | % | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sh