一、在上一篇文章中,使用ECS和mysql搭建mysql服务器搭建好了mysql服务器,现在需要远程连接
报错

2003 - Can't connect to MySQL server on '39.106.187.107' (60 "Operation timed out")

1、通过google在stackoverflow.com找到了问题这里写链接内容

2、这个方案貌似可行来试一下

3、说我没有安装nc

[root@iz2ze2llim71y07x3numlbz ~]# nc -l -p 3306
-bash: nc: 未找到命令
[root@iz2ze2llim71y07x3numlbz ~]# nc
-bash: nc: 未找到命令

4、安装一个nc,使用yum安装方便快捷

[root@iz2ze2llim71y07x3numlbz ~]# yum install nc
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 nmap-ncat.x86_64.2.6.40-7.el7 将被 安装
--> 解决依赖关系完成依赖关系解决================================================================================Package            架构            版本                    源             大小
================================================================================
正在安装:
 nmap-ncat          x86_64          2:6.40-7.el7            base          201 k事务概要
================================================================================
安装  1 软件包总下载量:201 k
安装大小:414 k
Is this ok [y/d/N]: y
Downloading packages:
nmap-ncat-6.40-7.el7.x86_64.rpm                            | 201 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装    : 2:nmap-ncat-6.40-7.el7.x86_64                               1/1
  验证中      : 2:nmap-ncat-6.40-7.el7.x86_64                               1/1 已安装:
  nmap-ncat.x86_64 2:6.40-7.el7                                                 完毕!

5、使用nc

[root@iz2ze2llim71y07x3numlbz ~]# nc -l -p 3306
Ncat: bind to :::3306: Address already in use. QUITTING.
[root@iz2ze2llim71y07x3numlbz ~]# 

6、使用nc,访问ip+端口

[root@iz2ze2llim71y07x3numlbz ~]# nc 59.110.218.184 3306
Ncat: Connection timed out.
[root@iz2ze2llim71y07x3numlbz ~]# 

If this is not working, this is not a mysql server configuration issue but a network issue, and you must check your router firewall rules.
Otherwise, your problem comes from mysql server settings. Check your mysql configuration file for bind-address, and remove them to make mysqld accept clients from any IP address.

7、可能是防火墙的问题
进入到/etc/sysconfig,看centos7没有iptables。

8、停止并屏蔽firewalld服务

[root@iz2ze2llim71y07x3numlbz sysconfig]# systemctl stop firewalld
[root@iz2ze2llim71y07x3numlbz sysconfig]# systemctl mask firewalld
Created symlink from /etc/systemd/system/firewalld.service to /dev/null.
[root@iz2ze2llim71y07x3numlbz sysconfig]#

9、安装iptables-services软件包

[root@iz2ze2llim71y07x3numlbz sysconfig]# yum install iptables-services
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 iptables-services.x86_64.0.1.4.21-18.3.el7_4 将被 安装
--> 正在处理依赖关系 iptables = 1.4.21-18.3.el7_4,它被软件包 iptables-services-1.4.21-18.3.el7_4.x86_64 需要

10、在引导时启用iptables服务

[root@iz2ze2llim71y07x3numlbz sysconfig]# systemctl enable iptables
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.

11、启动iptables服务

[root@iz2ze2llim71y07x3numlbz ~]# systemctl start iptables
[root@iz2ze2llim71y07x3numlbz ~]# 

12、保存防火墙规则

[root@iz2ze2llim71y07x3numlbz ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@iz2ze2llim71y07x3numlbz ~]# 

另外:管理iptables服务

systemctl [stop|start|restart] iptables

13、编辑防火墙规则,vi /etc/sysconfig/iptables

# Generated by iptables-save v1.4.21 on Mon Mar 26 17:50:59 2018
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [19:3404]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Mar 26 17:50:59 2018

14、重启防火墙,systemctl restart iptables

Mysql 远程连接的问题 2003 - Can't connect to MySQL server on '39.106.187.107' (60 Operation timed out)相关推荐

  1. Mysql 远程连接的问题 2003 - Can't connect to MySQL server on '39.106.187.107' (60 Operation timed out)...

    一.在上一篇文章中,使用ECS和mysql搭建mysql服务器搭建好了mysql服务器,现在需要远程连接 报错 2003 - Can't connect to MySQL server on '39. ...

  2. MySQL服务无法启动(2003 - Can‘t connect to MySQL server on‘localhost‘

    在安装完Navicat Premium15后 某天,突然报错....MySQL服务无法启动(2003 - Can't connect to MySQL server on'localhost'(0) ...

  3. mysql 遗失对主机的连接,MySQL远程连接丢失问题解决方法(Lost connection to MySQL server)...

    MySQL远程连接丢失问题解决方法(Lost connection to MySQL server) 最近服务器很不稳定,于是重装了mysql 和php 服务,但是接着却遇到了很头疼的麻烦. 远程连接 ...

  4. MySQL远程连接丢失问题解决方法(Lost connection to MySQL server)

    最近服务器很不稳定,于是重装了mysql 和php 服务,但是接着却遇到了很头疼的麻烦. 远程连接mysql是总是提示: 复制代码代码如下: Lost connection to MySQL serv ...

  5. MySQL之——MySQL远程连接丢失问题解决方法(Lost connection to MySQL server)

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/75008793 远程连接mysql是总是提示: Lost connection to ...

  6. mysql远程连接 Host * is not allowed to connect to this MySQL server

    原文链接:http://www.111cn.net/database/mysql/45230.htm 如果mysql不支持远程连接,会出现提示:错误代码是1130,ERROR 1130: Host * ...

  7. 解决MAC上Django连接Mysql django.db.utils.OperationalError: (2003, Can't connect to MySQL 的问题

    Steven 最近在mac电脑是开发Django项目,但是遇到了一个很棘手的问题,就是跑Django程序连接Mysql始终报错,最开始的问题是password的问题,后来把password改过来之后, ...

  8. MySQL远程连接ERROR 2003 (HY000) Cant connect to MySQL server on (10060)

    MySQL远程连接ERROR 2003 (HY000):Can't connect to MySQL server on'XXXXX' (10060)的问题 D:\Users\xiaomaimiao& ...

  9. 轻量应用服务器MySQL远程连接踩坑

    不算是给阿里云打广告吧,因为被阿里云的"云服务器ECS" 和 "轻量应用服务器"搞的很蛋疼.很多年前,阿里云的学生机"云翼计划"默认就只有& ...

最新文章

  1. Exchange Server 2003群集系统方案
  2. python全栈开发_day52_html模板继承和静态配置
  3. MySQL-8.0.12-winx64
  4. C#复制和深度复制的实现方法
  5. C# string转double,double转string
  6. Pycharm中设置py文件头部注释信息
  7. MaxCompute SQL中的更新和删除如何实现
  8. 虚拟机usb接口连接失败_Vmware虚拟机无法识别USB Key解决办法
  9. 证书错误:导航已阻止。此网站的安全证书有问题的解决办法
  10. 人格障碍及心理异常的调适
  11. FPGA中CDC问题
  12. Matplotlib绘制箱线图
  13. java毕业设计大众点评管理系统Mybatis+系统+数据库+调试部署
  14. spring源码学习之整合Mybatis原理分析
  15. rnns_告别rnns欢迎tcns
  16. ov511驱动移植 2.6.32.2
  17. Structural Consistency and Controllability for Diverse Colorization_ECCV_2018
  18. 关于服务器黑洞的说明
  19. LaTex 文本框与多行文本框
  20. 全球最大的社交编程及代码托管网站Github介绍

热门文章

  1. 西米支付:游戏支付接口怎么对接(经验总结)
  2. Spring属性注入DI
  3. 力量越大,责任就越大(瑞星杀毒将继续免费两个月)
  4. 守望先锋html网页设计,守望先锋-页面设计|网页|游戏/娱乐|梦冥轩- 原创作品 - 站酷 (ZCOOL)...
  5. 杭州起“艺”,西湖上新!先锋艺术家们带着作品来打卡啦!
  6. Unitree机器狗仿真(gazebo)
  7. 计算机设备交易,交易方法、计算机设备和存储介质与流程
  8. mac安装helm工具_Mac上安装Helm
  9. php think app_快来了解下TP6中的超级函数app()!
  10. I I love you