Home  >  Q&A  >  body text

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 days ago645

reply all(2)I'll reply

  • 高洛峰

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

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

    Indicates inserting this rule at the fourth line of the INPUT chain

    iptables: Index of insertion too big.

    It means there are not so many lines in your iptable

    iptables -S to see how many lines you have in totaliptables -S 看一下你一共多少行

    man iptables

    man iptables Please run it once before operating, otherwise it will be easy to disconnect the network directly with one command🎜

    reply
    0
  • 黄舟

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

    Do you want to use mysql database? According to your description, the service is not up. It has nothing to do with iptables

    reply
    0
  • Cancelreply