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 '