今天在centos7上装mysql8,装好了之后发现主机的navicat始终连不上centos中的mysql

搜索发现是防火墙的问题,已查看iptables,嗯?没有了这个防火墙,原来centos换防火墙为firewalld了。

一、firewalld的基本使用

  启动: systemctl start firewalld
  关闭: systemctl stop firewalld
  查看状态: systemctl status firewalld 
  开机禁用  : systemctl disable firewalld
  开机启用  : systemctl enable firewalld

二、systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

  启动一个服务:systemctl start firewalld.service
  关闭一个服务:systemctl stop firewalld.service
  重启一个服务:systemctl restart firewalld.service
  显示一个服务的状态:systemctl status firewalld.service
  在开机时启用一个服务:systemctl enable firewalld.service
  在开机时禁用一个服务:systemctl disable firewalld.service
  查看服务是否开机启动:systemctl is-enabled firewalld.service
  查看已启动的服务列表:systemctl list-unit-files|grep enabled
  查看启动失败的服务列表:systemctl --failed

三、.配置firewalld-cmd

  查看版本: firewall-cmd --version
  查看帮助: firewall-cmd --help
  显示状态: firewall-cmd --state
  查看所有打开的端口: firewall-cmd --zone=public --list-ports
  更新防火墙规则: firewall-cmd --reload
  查看区域信息:  firewall-cmd --get-active-zones
  查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
  拒绝所有包:firewall-cmd --panic-on
  取消拒绝状态: firewall-cmd --panic-off
  查看是否拒绝: firewall-cmd --query-panic
  开启端口
  添加
    firewall-cmd --zone=public --add-port=80/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)
  重新载入
    firewall-cmd --reload
  查看
    firewall-cmd --zone= public --query-port=80/tcp
  删除
    firewall-cmd --zone= public --remove-port=80/tcp --permanent

CentOS7防火墙之firewalld的更多相关文章

  1. CentOS7 防火墙规则 (firewalld)

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld  停止: systemctl disab ...

  2. CentOS7防火墙管理firewalld

    学习apache安装的时候需要打开80端口,由于centos 7版本以后默认使用firewalld后,网上关于iptables的设置方法已经不管用了,想着反正iptable也不太熟悉,索性直接搬官方文 ...

  3. CentOS7防火墙firewalld 和 CentOS6防火墙iptables的一些配置命令

    CentOS7 防火墙 一.防火墙的开启.关闭.禁用.查看状态命令 (1)启动防火墙:systemctl start firewalld (2)关闭防火墙:systemctl stop firewal ...

  4. Centos7防火墙快速开放端口配置方法

    ▲这篇文章主要为大家详细介绍了Centos7防火墙开放端口的快速方法,感兴趣的小伙伴们可以参考一下! Firewalld服务是红帽RHEL7系统中默认的防火墙管理工具,特点是拥有运行时配置与永久配置选 ...

  5. centos7 防火墙

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  6. CentOS7 防火墙(firewall)的操作命令

    CentOS7 防火墙(firewall)的操作命令 安装:yum install firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 查 ...

  7. centos7 iptables和firewalld学习记录

    centos7系统使用firewalld服务替代了iptables服务,但是依然可以使用iptables来管理内核的netfilter 但其实iptables服务和firewalld服务都不是真正的防 ...

  8. 【RHEL7/CentOS7防火墙之firewall-cmd命令详解】

    目录 Firewalld zone firewall-cmd 开始配置防火墙策略 总结 Redhat Enterprise Linux7已默认使用firewalld防火墙,其管理工具是firewall ...

  9. [转帖]Centos7防火墙配置rich-rule实现IP端口限制访问

    Centos7防火墙配置rich-rule实现IP端口限制访问 2019-02-18 18:05:35 sunny05296 阅读数 2143  收藏 更多 分类专栏: Linux   版权声明:本文 ...

随机推荐

  1. 记一次centos7内核可能意外丢失(测试直接干掉)恢复方法

    本次是虚拟机装的centos7的内核不知原因以外丢失造成无法开机,开机显示找不到内核! 恢复方法: 挂载新的ISO文件,然后进入bios选择dvd启动. 启动后进入Troublesshooting,然 ...

  2. Java-01-问题解答

    问题一:Java类文件是否只能有一个公有类? 1测试代码: //信1603 李敦岳 20163520 //测试Java是否只能有一个公有类 //2017.10.2 public class Test ...

  3. JPA的锁机制

    JPA 各种实体锁模式的区别 字数2084 阅读304 评论0 喜欢4 为了能够同步访问实体,JPA提供了2种锁机制.这两种机制都可以避免两个事务中的其中一个,在不知情的情况下覆盖另一个事务的数据. ...

  4. Python内置函数之isinstance,issubclass

    isinstance判断一个变量的类型 >>> n1 = 10>>> isinstance (n1,int)True 判断n1是否是数字类型,如果是返回True如果 ...

  5. Python面向对象:获取对象信息

    学习笔记内容简介: 获取对象属性和方法的函数: type(): 判断对象类型 isinstance() : 判断class的类型 dir() : 获得一个对象的所有属性和方法 把属性和方法列出来是不够 ...

  6. 批量转换gbk编码的java代码为utf8

    #!/bin/bash echo $1 echo $# if [ ! $# -eq 1 ]; then     echo "usage:  ./gbk2utf8.sh src"   ...

  7. javaScript错误(一)Cannot call method 'addEventListener' of null

    Cannot call method 'addEventListener' of null 原因很简单,JavaScript代码中要引用到DOM对象,但是这个DOM对象在JavaScript执行后才会 ...

  8. qt——for循环里创建widget

    在for循环里创建 widget,比如test类 不能使用 test t; 而要使用 test t = new test(): for (i=0;i<=3;i++) { QPushButton* ...

  9. 【Python】唯品会购买商品

    操作过程:唯品会进入之后,搜索商品,浏览网页,略掉不能选择的尺寸,选择之后,点击商品选择数量的加号,然后加入购物车. 实现代码如下: # coding=utf-8 from selenium impo ...

  10. python 面向对象 析构方法

    实例化但从来没有调用他,就浪费了,就应该自动删除它 这个实例一直存在内存里 python有个垃圾自动回收机制 , 每段时间会自动刷新整个内存,把内存垃圾东西删除   析构函数: 在实例释放.销毁的时候 ...