CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下。

1.关闭防火墙

[root@localhost ~]# systemctl stop firewalld.service

2.禁止防火墙开机自启

[root@localhost ~]# systemctl disable firewalld.service

3.安装iptables service

yum -y install iptables-services

4.修改防火墙配置,如增加防火墙端口3306

vi /etc/sysconfig/iptables 

增加以下规则

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

保存退出后

重启防火墙使配置生效

[root@localhost ~]# systemctl restart iptables.service

设置防火墙开机启动

[root@localhost ~]# systemctl enable iptables.service

重启系统使设置生效

[root@localhost ~]# reboot

注意:mysql安装后,如果不关掉防火墙,则远程不能连接成功。

Centos7设置关闭防火墙的更多相关文章

  1. CentOS7/6 关闭防火墙

    CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...

  2. Centos7永久关闭防火墙

    Centos7永久关闭防火墙 查看防火墙状态: systemctl status firewalld.service 绿的running表示防火墙开启 执行关闭命令: systemctl stop f ...

  3. Centos7.0关闭防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下 1.直接关闭防火墙 systemctl stop firewalld.service #关闭firew ...

  4. centos7上关闭防火墙

    centos7上默认开启的是+firewalld,关闭了iptables 停止防护墙: systemctl stop firewalld.service 开机不启动: systemctl disabl ...

  5. 【Linux】CentOS7 打开关闭防火墙及端口

    一.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld1.firewalld的基本使用启动: systemctl start firewalld查状态:syst ...

  6. 003 centos7中关闭防火墙

    在centos7中,防火墙有了新的变化.下面是常用的几个命令. 1.查看状态 systemctl status firewalld 2.关闭防火墙 systemctl stop firewalld.s ...

  7. centos7 开放/关闭防火墙和端口

    --------------------------------------------------------------防火墙----------------------------------- ...

  8. centos7上面关闭防火墙

    CentOS 7.0默认使用的是firewall作为防火墙:若没有启用iptables 作为防火墙,则使用以下方式关闭防火墙: systemctl stop firewalld.service 关闭开 ...

  9. centos7下关闭防火墙

    查看防火墙:systemctl status firewalld.service 关闭防火墙:systemctl stop firewalld.service 以上方式是暂时的,重启系统则防火墙仍然开 ...

随机推荐

  1. SharePoint中使用C#跳转页面的研究

    最近开发SharePoint的时候遇到问题,不能完成跳转,于是归纳了一下方法(最后还是使用了js跳转,后台跳转被sharepoint限制了). 1.最常用的页面跳转(原窗口被替代):Response. ...

  2. 【转载】浅谈HTTP中Get与Post的区别

    [转载]http://www.cnblogs.com/hyddd/ Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE.URL全称是资源描述符,我们 ...

  3. Delphi 实现数字转大写

    从网上找的一段代码 /// <summary> /// 小写转大写 /// </summary> /// <param name="mmje"> ...

  4. mysql索引

    1.创建索引  (PRIMARY KEY,INDEX,UNIQUE) mysql>ALTER TABLE tbl_name ADD INDEX index_name (column list); ...

  5. windows下使用pip安装python的第三方lxml库

    lxml是Python语言里和XML以及HTML工作的功能最丰富和最容易使用的库.lxml库的安装和python其他第三方库的安装方法是一样的,只是可能由于一些细节上的失误导致安装失败. 工具 Pyt ...

  6. Introduction to Neural Machine Translation - part 1

    The Noise Channel Model \(p(e)\): the language Model \(p(f|e)\): the translation model where, \(e\): ...

  7. JQuery事件之鼠标事件

    鼠标事件是在用户移动鼠标光标或者使用任意鼠标键点击时触发的. ():click事件:click事件于用户在元素敲击鼠标左键,并在相同元素上松开左键时触发. $('p').click(function( ...

  8. ajax 提交表单文件上传

    <form action="" method="post" enctype="multipart/form-data" id=&quo ...

  9. ubuntu下安装numpy和matplotlib

    安装NumPy函数库--sudo apt-get install python-numpy 以及  sudo apt-get install python-scipy NumPy函数库的函数查看:Nu ...

  10. git gui 学习

    目的 自己以前使用过3,4个月的SVN,因为公司使用的是git,git gui.所以打算自学git gui,并记录一下学习心得.^_^ 原因 为什么不是学命令行而是用git gui呢.我觉得首先因为公 ...