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

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

问题一:服务器未开放默认MySQL端口3306导致访问失败

解决方法:

首先检查是否安装了iptables服务。如果没有,可以通过以下命令进行安装和配置:

yum -y install iptables-services

启动并验证iptables服务状态:

systemctl start iptables service iptables status

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

cd /etc/sysconfig/iptables

在文件末尾添加以下规则:

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

保存配置并重启iptables服务:

service iptables save service iptables restart

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

解决方法:

登录MySQL数据库:

mysql -u root -p

修改root用户的访问权限:

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

赋予root用户所有权限:

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

确保权限生效:

flush privileges;

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

解决方法:

按照云服务提供商的指南配置安全组规则。以阿里云为例:

进入云控制台,选择安全组,添加入站规则,指定源端口为3306,确认允许访问。

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

你可能感兴趣的文章
NN&DL4.8 What does this have to do with the brain?
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
Node.js 文件系统的各种用法和常见场景
查看>>
node.js 配置首页打开页面
查看>>
node.js+react写的一个登录注册 demo测试
查看>>
Node.js安装与配置指南:轻松启航您的JavaScript服务器之旅
查看>>
nodejs libararies
查看>>
nodejs-mime类型
查看>>
nodejs中Express 路由统一设置缓存的小技巧
查看>>
Node入门之创建第一个HelloNode
查看>>
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty()
查看>>
npm run build 失败Compiler server unexpectedly exited with code: null and signal: SIGBUS
查看>>
npm WARN deprecated core-js@2.6.12 core-js@<3.3 is no longer maintained and not recommended for usa
查看>>
npm和yarn的使用对比
查看>>
npm报错unable to access ‘https://github.com/sohee-lee7/Squire.git/‘
查看>>