Remote connection to CentOS MySQL error: Can ' t connect to MySQL server on ' XXX ' (13)

Source: Internet
Author: User

Environment:

System version: CentOS release 6.5 (Final)

Database version: 5.1.73


Problem Description:

Using client Telnet connection on a CentOS 6.5 server based on MySQL, error: Can ' t connect to MySQL server on ' XXX ' (13)


Workaround:

Typically, you can set the following settings
1. Go to MySQL console
# mysql-u root-p

2. Enter the following command in the MySQL console
mysql> grant all privileges on * * to ' root ' @ ' Your-host-ip ' identified by ' Your-mysql-pass Word ' with GRANT option;
Mysql> flush Privileges;
Mysql> exit

3. Restart MySQL
#/etc/init.d/mysqld Restart
At this point, no unexpected changes have been made and validation passed.

However, if you still see the error prompt for can ' t connect to MySQL server on ' XXX ' (13), you can try the following:

1. View Httpd_can_network_ Whether the value of Connect is off (for example: Httpd_can_network_connect-to-off)
# Getsebool-a | grep httpd

2. Modify Httpd_can_network_ The value of Connect is on
# setsebool Httpd_can_network_connect 1

3. Re-verify Httpd_can_network_connect
# Getsebool-a | grep httpd

4. Restart the HTTP
#/etc/init.d/httpd restart

5. Enter the client to restart login verification
At this point the error message becomes: Access denied for user ' Root ' @ ' Your-host-ip ' (usring password:yes)

6. Go to MySQL console re-grant (above)

Remote connection to CentOS MySQL error: Can ' t connect to MySQL server on ' XXX '

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.