CENTOS7 Open MySQL 3306 port and set up external access

Source: Internet
Author: User

MySQL is installed by default after the installation of localhost access, if you need external access to set a new account to change the host to%, meaning that all IP can access

Grant all privileges on * * to ' outuser ' @ '% ' identified by ' + ' with GRANT option

And then

Flush privileges;

You can use Outuser account password 12来 external access, sometimes inaccessible need to open firewall open port

The Firewall-cmd command is used in CentOS 7

# firewall-cmd--list-all-zones    #查看所有的zone信息 # firewall-cmd--get-default-zone     #查看默认zone是哪一个 # firewall-cmd-- Zone=internal--change-zone=p3p1  #临时修改接口p3p1所属的zone为internal # firewall-cmd--add-service=http    #暂时开放http # Firewall-cmd--permanent--add-service=http  #永久开放http # firewall-cmd--zone=public--add-port=80/tcp--permanent  #在public中永久开放80端口 # firewall-cmd--permanent--zone=public--remove-service=ssh   #从public Zone Removal Service # Firewall-cmd--reload   #重新加载配置

Open Port 3306

Firewall-cmd--add-port=3306/tcp--permanent

Ok

CENTOS7 Open MySQL 3306 port and set up external access

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.