Solve the MySQL connection error: Can't connect to MySQL server (10060)

Source: Internet
Author: User

Solve the MySQL connection error: Can't connect to MySQL server (10060)

When you use the graphic interface management tool Navicat forMySQL to connect to the Mysql database, the following error occurs: Can't connect to MySQL server (10060)

Cause:

Some problems may be caused by the following reasons:

1. The network is disconnected;

2. The service is not started;

3. Firewall ports are not open;

Solution:

Start the service:

[Plain] view plaincopy
  1. Servicemysqldstart;

After analysis, the problem I encountered was caused by the firewall!

Open firewall port
Add the port to be listened on
/Sbin/iptables-I INPUT-p tcp -- dport 3306-j ACCEPT

Save settings
/Etc/init. d/iptables save

View status
/Etc/init. d/iptables status

Temporarily disable the Firewall Service
Service iptables stop

Enable Firewall Service
Service iptables start

Start the Firewall Service again
Chkconfig iptables off

Note:
This document applies to server environments: CentOS 6.5 MySQL 5.6

If the Java program cannot connect to the database, see: Connections cocould not be acquired from the underlying database

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.