2003 - Can‘t connect to MySQL server on ‘127.0.0.1‘ (61 “Connection refused“)

  1. navicat 连接不上mysql,可把我急坏了
  2. 首先是说拒绝连接

错误原因: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';
  1.  然后我又出现了下面的问题:
  2. 1045- Access denied for user 'root'@'localhost' (using password: YES)
  3. 意思就是密码对了,就是拒绝你上去,然后就要改一下mysql的配置:
  4. cd /usr/local/mysql/etc
    vim my.cnf
    

    #不能修改的话记得sudo一下
    #vim格式下:w 进入编辑模式

  5. # 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值