Enable MySQL remote access in centos

Source: Internet
Author: User
Tags mysql command line
By default, mysql does not allow remote access. now you need to add a mysql account with original access (you need to go to the mysql Command Line): GRANTALLPRIVILEGESON *. * TOremote @ % IDENTIFIEDBY the plaintext password WITHGRANTOPTION for remote logon; execute the following statement to take effect: flushprivileges; at ce

By default, mysql does not allow remote access. now you need to add a mysql account with original access (you need to enter the mysql Command Line): grant all privileges on *. * TO remote @ % identified by 'plaintext password for remote logins 'with grant option; execute the following statement TO apply: flush privileges; On ce

By default, mysql does not allow remote access.

Now you need to add a mysql account with original access (you need to enter the mysql Command Line ):

Grant all privileges on *. * TO remote @ "%" identified by 'plaintext password for remote logon 'with grant option;

Execute the following statement to take effect:

Flush privileges;

In centos, iptables is enabled by default, but port 3306 is not enabled. You need to manually specify this parameter.

Log out of mysql and enter:

Vi/etc/sysconfig/iptables

Add the following string

-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT

Restart iptables:

/Etc/rc. d/init. d/iptables restart

Now you can connect to the remote mysql database ~

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.