Troubleshooting MySQL Remote connection ports and permissions under CentOS

Source: Internet
Author: User

1. In the CentOS system firewall is blocked by default 3306 port, if we want to access the MySQL database, we need this port, the command is as follows:

/sbin/iptables-i input-p TCP--dport 3036-j ACCEPT

We need to save our operation with the following command:

/etc/rc.d/init.d/iptables Save

At this point we can view the status of the port, with the following command:

/etc/init.d/iptables status

Of course if you open the other ports as well, just transfer the port number to the port number you need.

2. A workaround for modifying permissions for remote connections occurs with 1045 errors:

GRANT all privileges on * * to ' yourusername ' @ '% ' identified by "YourPassword";

This article is from the "Kunka" blog, make sure to keep this source http://kunka.blog.51cto.com/2061950/1574224

Troubleshooting MySQL Remote connection ports and permissions under CentOS

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.