Enable mysql remote connection in Linux

Source: Internet
Author: User
In Linux, how does one enable mysql remote connection? mysql remote connection linuxserviceserveruserMysql is accessible only to local root users by default, but cannot be remotely connected to and managed mysql databases. how does one enable mysql remote connection in Linux? The procedure is as follows: 1. run the GRANT command to create a remote Linux instance to enable mysql remote connection.
Mysql remote connection linuxserviceserveruserMysql by default, the root user can only access the local database, but cannot remotely connect to and manage the mysql database. how does one enable mysql remote connection in Linux? The procedure is as follows:
1. GRANT command to create a remote connection mysql authorized user test
Mysql-u root-p
Mysql> grant all privileges on *. * TO test @ localhost identified by 'test' with grant option;
Mysql> grant all privileges on *. * TO test @ "%" identified by 'test' with grant option;

In the first sentence, the itlogger user is authorized to access through the local machine (localhost) and the password is 'test '. The second sentence is to authorize the test user to initiate access from any other host (wildcard % ).
2. set the firewall to allow port 3306
Vi/etc/sysconfig/iptables
Add
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
(Note that before-A RH-Firewall-1-INPUT-j REJECT -- reject-with icmp-host-prohibited, otherwise the rule may not take effect)
Restart firewall service iptables restart

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.