CentOS MySQL error: Can't connect to MySQL server on 'xxx' (13)
Environment:
System Version: CentOS release 6.5 (Final)
Database Version: 5.1.73
Problem description:
Use the client to remotely log on to Mysql on the CentOS 6.5 server. The error "Can't connect to MySQL server on 'xxx' (13)" is returned)
Solution:
Generally, you can perform the following settings:
1. log on to the 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-password' with grant option;
Mysql> flush privileges;
Mysql> exit
3. Restart Mysql
#/Etc/init. d/mysqld restart
So far, no accident has been completed, and the verification has passed.
However, if the error message "Can't connect to MySQL server on 'xxx' (13)" still appears, try the following method:
1. Check whether the value of httpd_can_network_connect is off (for example, httpd_can_network_connect --> off)
# Getsebool-a | grep httpd
2. Change the value of httpd_can_network_connect to on.
# Setsebool httpd_can_network_connect 1
3. Verify httpd_can_network_connect again.
# Getsebool-a | grep httpd
4. Restart http
#/Etc/init. d/httpd restart
5. log on to the client and restart the client for Logon verification.
The error message becomes: Access denied for user 'root' @ 'your-host-ip' (usring password: YES)
6. log on to the Mysql console and re-GRANT (as shown above)