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

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

  •  
  •   treedon · Nov 20, 2017 · 14231 views
    This topic created in 3095 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
        1
    hcymk2  
       Nov 20, 2017
    iptables -I
    iptables -A
    treedon
        2
    treedon  
    OP
       Nov 20, 2017
    @hcymk2 这两个命令都没哦
    我的是 contos6.5
    gouchaoer
        3
    gouchaoer  
       Nov 20, 2017
    chkconfig 里面关闭 iptables
    然后停掉 iptables 服务,over
    hcymk2
        4
    hcymk2  
       Nov 20, 2017
    @treedon
    iptables --line-numbers -L INPUT
    看下你有多少行规则。
    jasonyang9
        5
    jasonyang9  
       Nov 20, 2017
    把 4 去掉大概就可以了
    raysonx
        6
    raysonx  
       Nov 20, 2017 via Android
    你知道-I 后面那个 4 是什么意思吗?
    网上的文章给你一条 rm -rf /你也敢输入对吧
    hugee
        7
    hugee  
       Nov 20, 2017 via Android
    oneinstack 大而杂,比较垃圾。
    tempdban
        8
    tempdban  
       Nov 20, 2017
    @gouchaoer oneinstack 的安全组用的是 iptables,你知道关了有啥影响么?
    动一动脑,多学学,别没事就喷着喷那的。
    tempdban
        9
    tempdban  
       Nov 20, 2017
    @gouchaoer 对不起,我这自己打脸了,我以为是 onestack,抱歉
    treedon
        10
    treedon  
    OP
       Nov 20, 2017
    @hcymk2 四条规则
    treedon
        11
    treedon  
    OP
       Nov 20, 2017
    @gouchaoer 关掉会不会出啥事啊?
    sublimevsatom
        12
    sublimevsatom  
       Nov 20, 2017
    楼上有同学说了,
    根据提示来,
    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
        13
    wqtacc  
       Nov 20, 2017
    你应该没有 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   ·   Solana   ·   921 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 20:34 · PVG 04:34 · LAX 13:34 · JFK 16:34
    ♥ Do have faith in what you're doing.