Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
treedon
V2EX  ›  Linux

[急!!!]打开 3306 端口 遇到 Index of insertion too big!

  •  
  •   treedon · Nov 20, 2017 · 14640 views
    This topic created in 3280 days ago, the information mentioned may be changed or developed.
    百度,谷歌这个报错 都没什么答案..
    我的环境是用 oneinstack 集成包装的, 想设置 mysql 允许远程连接
    然后找到了这个文章 https://oneinstack.com/question/298/
    BUT.
    我一执行 iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
    就会提示 iptables: Index of insertion too big.
    咋办啊,网上找了好久 没找到解决方案
    mysql 本机连接没问题, 外部连接不了现在
    13 replies  •  2017-11-20 23:23:41 +08:00
    hcymk2
    hcymk2
    Nov 20, 2017
    1
    iptables -I
    iptables -A
    treedon
    treedon
    OP
    Nov 20, 2017
    2
    @hcymk2 这两个命令都没哦
    我的是 contos6.5
    gouchaoer
    gouchaoer
    Nov 20, 2017
    3
    chkconfig 里面关闭 iptables
    然后停掉 iptables 服务,over
    hcymk2
    hcymk2
    Nov 20, 2017
    4
    @treedon
    iptables --line-numbers -L INPUT
    看下你有多少行规则。
    jasonyang9
    jasonyang9
    Nov 20, 2017
    5
    把 4 去掉大概就可以了
    raysonx
    raysonx
    Nov 20, 2017 via Android
    6
    你知道-I 后面那个 4 是什么意思吗?
    网上的文章给你一条 rm -rf /你也敢输入对吧
    hugee
    hugee
    Nov 20, 2017 via Android
    7
    oneinstack 大而杂,比较垃圾。
    tempdban
    tempdban
    Nov 20, 2017
    8
    @gouchaoer oneinstack 的安全组用的是 iptables,你知道关了有啥影响么?
    动一动脑,多学学,别没事就喷着喷那的。
    tempdban
    tempdban
    Nov 20, 2017
    9
    @gouchaoer 对不起,我这自己打脸了,我以为是 onestack,抱歉
    treedon
    treedon
    OP
    Nov 20, 2017
    10
    @hcymk2 四条规则
    treedon
    treedon
    OP
    Nov 20, 2017
    11
    @gouchaoer 关掉会不会出啥事啊?
    sublimevsatom
    sublimevsatom
    Nov 20, 2017
    12
    楼上有同学说了,
    根据提示来,
    iptables: Index of insertion too big.
    说明你 insert 的这个 4 的位置并不存在, 具体你可以看一下--line-numbers。

    所以
    iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
    应该是可以的。
    wqtacc
    wqtacc
    Nov 20, 2017
    13
    你应该没有 4 这个位置吧,这个错误大概是命令向第 4 行插入,结果超过了 INPUT 行号;
    试试插入到开始位置:
    iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
    PS. mysql 远程访问先考虑是不是 mysql 的用户权限开放了远程客户端登录。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3590 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 09:54 · PVG 17:54 · LAX 01:54 · JFK 04:54
    ♥ Do have faith in what you're doing.