CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl mask firewalld.service
 
2、安装iptables防火墙
yum install iptables-services -y
3.启动设置防火墙
# systemctl enable iptables
# systemctl start iptables
 
4.查看防火墙状态
systemctl status iptables
5编辑防火墙,增加端口
vi /etc/sysconfig/iptables #编辑防火墙配置文件
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
:wq! #保存退出
 
3.重启配置,重启系统
systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
 
 
//新建mysql用户并授权
grant all privileges on *.* to test@localhost identified by 'q123456';

最新文章

  1. iOS 视图:重绘与UIScrollView(内容根据iOS编程编写)
  2. Jquery基础知识
  3. 关于JSPatch热修复
  4. 全真模拟 (1) day1
  5. 利用zxing制作彩色,高容错,支持中文等UTF编码的QR二维码图片
  6. 【Android自学之旅】 Android开发环境的搭建
  7. Linux学习系列之Linux入门(二)Vim学习
  8. Android在onCreate()中获得控件尺寸
  9. linux下利用openssl来实现证书的颁发(详细步骤)
  10. js原生封装自定义滚动条
  11. JavaFx初探
  12. x240 uefi ubuntu 12.04.4
  13. hdu_5831_Rikka with Parenthesis II(模拟)
  14. 【转】ActiveMQ与虚拟通道
  15. win8 wifi开关显示关闭,且设置里面wifi开关显示灰色的解决办法
  16. 关于 Senparc.Weixin.Cache.Redis 引用的 StackExchange.Redis 版本不匹配的反馈测试
  17. [Swift]LeetCode109. 有序链表转换二叉搜索树 | Convert Sorted List to Binary Search Tree
  18. Vsphere 回收未消使用的磁盘空间
  19. LeetCode - Diameter of Binary Tree
  20. github 与gitlab之间的工程创建

热门文章

  1. iPhone Tutorials
  2. 用NSCoding协议完成“编码/解码”操作-Object-C
  3. 2890: C--去掉+86
  4. feature map计算大小公式
  5. iOS开发各种证书问题
  6. Spring框架中的aop操作之二 通过配置文件实现增强
  7. Python基础:列表(list)和元组(tuple)
  8. 【01】如何在XMind中排列自由主题
  9. luogu3231 [HNOI2013]消毒
  10. Silverlight客户端加载DWG图纸方案