Configure iptables firewall for CentOS to allow external MySQL access

Source: Internet
Author: User
Abstract: By default, the iptables information filtering system is installed in centos. Currently, you need to configure the system to allow remote access to mysql. Related Knowledge: iptables related 1. iptables service/etc/init. d/iptablesstart | stop | restart |... 2. configuration file location/etc/sysconfig/iptables-config3, policy file Abstract:
   CentosBy default IptablesInformation filtering system. MysqlRemote access.
Related knowledge:
   Iptables problems
1. iptables service/etc/init. d/iptablesstart | stop | restart |...
2. configuration file location/etc/sysconfig/iptables-config
3. location of the policy file/etc/sysconfig/iptables (the default value does not exist. you can use service ipatablessave to save the current policy)
4. View iptables-L (if you specify to view a rule, for example, iptables-l input is used for INPUT)
5. create a rule iptables... for example: (For more details, see iptables firewall configuration in RHEL5.7)
 

6. save the current rule service iptables save (or/etc/init. d/iptables save or iptables-save>/etc/sysconfig/iptables)
Save is to append the rule to a file, mainly with the iptables-restore command
7. restore policy file service iptables restore
  
Mysql access configuration:
Iptables-a input-p tcp-m state -- state NEW-m tcp -- dport 3306-j ACCEPT
Service iptables save
Service iptables restart

Related questions:
1. configure/sbin/iptables and check their differences.
/Bin is generally a common executable program, while/sbin is mostly a system management program and a service program.
S should be the word "system ".
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.