- navicat 连接不上mysql,可把我急坏了
- 首先是说拒绝连接
错误原因:MySQL新版本(8以上版本)的用户登录账户加密方式是【caching_sha2_password】,Navicat不支持这种用户登录账户加密方式。
方法:不管什么系统,先进去你的mysql,然后输入一下命令,检查编码方式
show variables like 'default_authentication_plugin';
如果是:caching_sha2_password,则更改编码方式:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
- 然后我又出现了下面的问题:
- 1045- Access denied for user 'root'@'localhost' (using password: YES)
- 意思就是密码对了,就是拒绝你上去,然后就要改一下mysql的配置:
-
cd /usr/local/mysql/etc vim my.cnf
#不能修改的话记得sudo一下
#vim格式下:w 进入编辑模式 -
# Example MySQL config file for medium systems. # # This is for a system with little memory (32M - 64M) where MySQL plays # an important part, or systems up to 128M where MySQL is used together with # other programs (such as a web server) # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You can copy this option file to one of those # locations. For informa