首頁  >  問答  >  主體

mysql - ubuntu开启3306端口失败,有什么办法可以解决?

通过以下命令查询,3306端口,竟然返回空的,3306端口没有开启

netstat -an|grep 3306

然后就使用以下命令

iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

来开启3306,但是显示以下错误

iptables: Index of insertion too big.

是什么原因呢?

还有什么方法可以开启3306的端口吗?
需要做远程链接

大家讲道理大家讲道理2742 天前637

全部回覆(2)我來回復

  • 高洛峰

    高洛峰2017-04-17 16:48:21

    iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

    表示在INPUT chain中第四行的位置插入這條rule

    iptables: Index of insertion too big.

    說明你的iptable裡面沒有那麼多行

    iptables -S 看一下你總共多少行iptables -S 看一下你一共多少行

    man iptables

    man iptables 先捋一遍再操作,不然很容易一條指令直接斷網🎜

    回覆
    0
  • 黄舟

    黄舟2017-04-17 16:48:21

    你是要用mysql資料庫麼?根據你的描述是服務沒起來,跟iptables沒關係

    回覆
    0
  • 取消回覆