Remote connection to MySQL in CentOS: Can & #39; t connect to MySQL server on & #39; XXX & #39; (13), centosmysql

Source: Internet
Author: User

Remote connection to MySQL in CentOS: Can't connect to MySQL server on 'xxx' (13), centosmysql
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)

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.