注:原因为MySql 8.0.11换了新的身份验证插件(caching_sha2_password), 原来的身份验证插件为(mysql_native_password)。而客户端工具找不到新的身份验证插件(caching_sha2_password),将mysql用户使用的登录密码加密规则还原成mysql_native_password,即可登陆成功。
1、无密码本机登录
在/etc/my.cnf添加下面配置
skip-grant-tables(注意:开启该权限,就无法远程登录mysql,3306端口会被关闭)
重启mysqld即可无密码登录
2、查看用户身份验证类型
mysql> select user,plugin from user where user='root';
+------+-----------------------+
| user | plugin |
+------+---------------------