CentOS MySQL error: Can 'tconnecttomysqlserveron 'XXX' (13)

Source: Internet
Author: User
When you remotely connect to CentOS MySQL, the following error occurs: CantconnecttoMySQLserveronXXX (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)

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.