很多人装了MySQL8.0,然后使用Navicat等客户端登录的时候报了以下错误:
原因
MySQL8.0使用新的密码验证插件caching_sha2_password,而MySQL8.0以下的,只要不是太旧的客户端,都是使用mysql_native_password验证插件,两个插件不兼容导致了登录异常
[root@mysql8 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like 'default_authentication_plugin';
+-------------------------------+-----------------------+
| Variable_name