阿里云MySQL远程登录异常

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/starjuly/article/details/83987790

报错如下

Connection to [email protected] failed.
[08S01] Communications link failure.
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

原因分析

如果IP地址没有错,远程连接配置没问题,数据库能在云服务器中能启动,也能ping通改IP地址,那么有可能就是阿里云服务器的端口没有开放。

解决方案

  1. 登录 云服务器ECS管理控制台。
  2. 在左侧导航栏中,选择 网络和安全 > 安全组。
  3. 选择地域。
  4. 找到要配置授权规则的安全组,在 操作 列中,单击 配置规则。
  5. 在 安全组规则 页面上,单击 添加安全组规则。
    参考示例:
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/starjuly/article/details/83987790