当前位置:网站首页>服务器的数据库连不上了【服务已起、防火墙已关、端口已开、netlent 端口不通】
服务器的数据库连不上了【服务已起、防火墙已关、端口已开、netlent 端口不通】
2022-06-29 14:52:00 【华为云】
服务器的数据库连不上了【服务已起、防火墙已关、端口已开、netlent 端口不通】
首先说明:这篇文章针对 服务已经起来了、防火墙是关闭的、安全组端口也打开了,在docker 容器中可以连接MySQL,但是Navicat中不能连,同时 netlent IP 端口 也不同,Navicat报错如下:

如果你也是这种奇葩问题,你可以看下下面的解决方案。
首先确认下防火墙状态
systemctl status firewalld

没毛病,在关着。
再看下端口
netstat -antulp | grep XXXX

也没毛病,docker mysql 起来端口就在使用,docker mysql 关闭的话,端口就未使用
自己确认下自己服务器的安全组对应的端口是否打开了
telnet IP 端口 测试连接下

结果是连接失败,没事,接着往下
执行命令:cat /proc/sys/net/ipv4/ip_forward

注意,这里是0,是不对的,0表示
ipv4转发出于关闭状态我们需要修改成 1
执行命令echo 1 > /proc/sys/net/ipv4/ip_forward

这样我们就
开启了ipv4转发
Navicat 重连

OK,这样就搞定了,不知因为什么原因导致 ipv4转发 关闭了
可能的原因:
重启服务器后被恢复了
部分进程可能修改了系统设置
我们把ipv4转发打开就好了,因为 服务器里面部署容器的话是需要开启ip转发功能的,一般不需要我们自己处理的,不知为啥遇到了,我们开启就可以解决问题了。
版权声明:
原创博主:牛哄哄的柯南
个人博客链接:https://www.keafmd.top/
看完如果对你有帮助,感谢点击下面的点赞支持!
[哈哈][抱拳]
加油!
共同努力!
Keafmd
边栏推荐
- How word automatically generates directories
- 二级指针
- 信息学奥赛一本通1002:输出第二个整数
- MCS:离散随机变量——Poisson分布
- 携程季报图解:净营收41亿 与疫情前相比已被“腰斩”
- Implementing redis distributed locks using custom annotations
- MCS:离散随机变量——Pascal分布
- Unity C basic review 27 - delegation example (p448)
- Lumiprobe deoxyribonucleic acid phosphate CpG 1000 solid carrier
- MCS:离散随机变量——几何分布
猜你喜欢

阿尔兹海默病智能诊断

MCS: discrete random variable Pascal Distribution

Lumiprobe reactive dye cycloalkyne dye: af488 dbco, 5 isomer

PostgreSQL learning (based on rookie course)

Weigao blood purification sprint to Hong Kong: annual revenue of RMB 2.9 billion, net profit decreased by 12.7%

Draw a slash on a plane coordinate

MCS:多元随机变量——多项式分布

卫龙更新招股书:年营收48亿 创始人刘卫平家族色彩浓厚

Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders

MCS: multivariate random variable - discrete random variable
随机推荐
Illustration of Ctrip quarterly report: net revenue of RMB 4.1 billion has been "halved" compared with that before the outbreak
Paper study -- accurate accounting of annual total runoff control rate considering the interannual variation characteristics of rainfall
Chapter IX app project test (4) test tools
如临现场的视觉感染力,NBA决赛直播还能这样看?
我 35 岁,可以转行当程序员吗?
SOFARegistry 源码|数据同步模块解析
Analysis of constant current source circuit composed of two NPN tubes
Lumiprobe reactive dye cycloalkyne dye: af488 dbco, 5 isomer
关于遥感图像解译的思考
China soft ice cream market forecast and investment prospect research report (2022 Edition)
文本预处理库spaCy的基本使用(快速入门)
Unity C # basic review 26 - first acquaintance Commission (p447)
Const usage
MCS:多元随机变量——离散随机变量
Informatics Olympiad all in one 2062: movie tickets
Get the width of text component content
message from server: “Host ‘xxxxxx‘ is blocked because of many connection errors; unblock with ‘m
Chaîne lumineuse libre biovendor κ Et λ) Propriétés chimiques du kit ELISA
Hi, you have a code review strategy to check
携程季报图解:净营收41亿 与疫情前相比已被“腰斩”