博客
关于我
Navicat连接 CentOS7 的 Mysql 出现10060 Unknow Error问题解决
阅读量:107 次
发布时间:2019-02-26

本文共 725 字,大约阅读时间需要 2 分钟。

问题一:由于服务器没有对外开放mysql的默认端口3306导致

解决方式:


1.首先看看有没有 iptables

cd etc/sysconfigls

2.如果没有,则首先下载一下 iptables 服务

yum -y install iptables-services

3.开启 iptables 服务,可以查看状态

systemctl start iptablesservice iptables status

4.编辑iptables 配置文件,添加 3306 端口

4.1 进入并编辑 iptables

cd /vi etc/sysconfig/iptables

4.2 将该代码复制到 iptables 文件底部

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

5.保存 iptables 并且 重启 iptables 服务

service iptables save
service iptables restart

问题二: mysql 没有开启对外访问权限

解决方式:

1.登陆到 mysql 里面

mysql -u root -p

**2.修改host 为 % **

use mysql;update user set host = '%' where user ='root';

3.修改权限

grant all privileges on *.* to 'root'@'%'

4.使修改生效

flush privileges;

问题三: 阿里云或者是腾讯云的安全组规则开放3306端口

解决方法:(以阿里云为例子)

在这里插入图片描述

转载地址:http://fdsk.baihongyu.com/

你可能感兴趣的文章
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named 'pandads'
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No qualifying bean of type ‘com.netflix.discovery.AbstractDiscoveryClientOptionalArgs<?>‘ available
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
no session found for current thread
查看>>
No static resource favicon.ico.
查看>>
no such file or directory AndroidManifest.xml
查看>>
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
查看>>
NO.23 ZenTaoPHP目录结构
查看>>