centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

 

阿里云服务器centos 7;

2003-can't connect to MYSQL server on'479496.122(10060)

原因,没有开启3306端口;

1.查看防火墙状态是否开启:

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

firewall-cmd --state

2.查看阿里云服务器,安全组规则,是否添加3306端口;

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

3.如果未添加:添加如下:

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

 

4.查看防火墙是否开启的端口;

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

firewall-cmd --list-ports

5.防火墙如果没有开启3306端口;则添加3306端口:

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

firewall-cmd --zone=public --add-port=3306/tcp --permanent

6.重启防火墙:

   {

停止防火墙命令

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

systemctl stop firewalld.service

开启防火墙命令

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

systemctl start firewalld.service

重启防火墙命令

systemctl restart firewalld.service      

}

7.检查防火墙是否开启3306端口

centos7 mysql数据库链接 2003-can‘t connect to MYSQL server on‘479496.122(10060)

firewall-cmd --list-ports

 

 

 

 

相关文章:

  • 2021-10-28
  • 2021-10-16
  • 2021-05-15
  • 2021-11-26
  • 2022-03-06
  • 2022-12-23
  • 2021-10-10
  • 2022-02-26
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2021-11-20
  • 2022-02-09
  • 2021-08-25
  • 2021-04-15
相关资源
相似解决方案