当前位置:网站首页>服务器的数据库连不上了【服务已起、防火墙已关、端口已开、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
边栏推荐
- MCS: discrete random variable - binomial distribution
- Konva series Tutorial 4: drawing attributes
- Lumiprobe deoxyribonucleic acid alkyne DT phosphimide
- Whitelabel error page access
- 高並發軟件(網站,服務器端接口)的評價指標
- LeetCode笔记:Biweekly Contest 81
- China arsenic trioxide industry research and future forecast report (2022 Edition)
- 信息学奥赛一本通1000:入门测试题目
- 华理生物冲刺科创板:年营收2.26亿 拟募资8亿
- Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders
猜你喜欢

EMC surge protection and decoupling design

MCS: multivariate random variable polynomial distribution

威高血液净化冲刺香港:年营收29亿 净利降12.7%

Implementing redis distributed locks using custom annotations

Hi, you have a code review strategy to check

如临现场的视觉感染力,NBA决赛直播还能这样看?

【牛客网刷题系列 之 Verilog快速入门】~ 移位运算与乘法

Intelligent diagnosis of Alzheimer's disease

Redis installation in windows and Linux Environment

Whitelabel error page access
随机推荐
symfony框架安全组件(security)防火墙配置
Knowledge points: what are the know-how of PCB wiring?
Unity C basic review 28 - delegation with return (p449)
For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?
Is it safe to open a stock account at present? Can I open an account online directly
message from server: “Host ‘xxxxxx‘ is blocked because of many connection errors; unblock with ‘m
Northwestern Polytechnic University attacked by overseas e-mail
信息学奥赛一本通1000:入门测试题目
Indice d'évaluation du logiciel hautement simultané (site Web, interface côté serveur)
MCS: multivariate random variable polynomial distribution
Hi,你有一份Code Review攻略待查收
China soft ice cream market forecast and investment prospect research report (2022 Edition)
如临现场的视觉感染力,NBA决赛直播还能这样看?
Secondary pointer
极化SAR地表分类
文本预处理库spaCy的基本使用(快速入门)
Uncover the practice of Baidu intelligent test in the field of automatic test execution
MCS: discrete random variable Poisson distribution
wieshark抓包mysql协议简单分析
第九章 APP项目测试(此章完结)