Ошибка sql 10060

Причин возникновения ошибки 10060 при подключении к серверу MySQL может быть несколько:

  1. Проверьте настройки межсетевого экрана (файрвола). В них обязательно должен быть открыт порт 3306 по протоколам TCP и UDP.
  2. Проверьте, настроен ли ваш MySQL-сервер на работу по сети. У вашем конфигурационном файле не должно быть директивы skip_networking.
  3. Проверьте, что ваш MySQL-сервер слушает нужный IP адрес, т.е. подключение к серверу возможно с тех IP адресов, с которых вы производите подключение. Иногда сервер слушает только внутренний сетевой интерфейс локальной сети, а попытка доступа осуществляется с другого, например, внешнего интерфейса.
  4. Проверьте, что ваш MySQL-сервер слушает именно нужный порт 3306, а не какой-то другой, иначе в клиентской программе нужно указывать именно этот, другой порт.
  5. Ну и наконец, что MySQL-сервер просто запущен

Простейшим способом убедиться, что пункты 2-5 работают, является выполнение команды:

# netstat -tnlp |grep 3306

в результате которой вы должны получить, что-то такое:

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      2472/mysqld

в данном случае, MySQL-сервер слушает на порту 3306 соединения по любому IP-адресу (0.0.0.0). Также мы видим, что сам MySQL сервер запущен и его идентификатор процесса: 2472.

SQL Server Error: 10060
Severity: 0
Event Logged or not: No
Description:
An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)
Severity 0 Description:
Informational messages that return status information or report errors that are not severe. The Database Engine does not raise system errors with severities of 0 through 9.

Solution for Resolving the Error

Ensure that the firewall on the machine is configured to allow this instance of SQL Server to receive connections. That instance, if you are connecting from within a business network, your network’s firewall may not allow outbound communication over port 1433.

To connect to your Azure SQL Database server you will need port 1433 enabled on Firewall which your IT department can help with to allow port 1433 to be opened.

On the Azure side, make sure the NSG (related with the subnet where the Azure SQL server is located) enables the client IP to connect to the specified port 1433.
If a server-level firewall is enabled, add the client IP to the SQL server firewall settings.

Alternate Solutions to try

Use Telnet  to the current IP of your Azure SQL Database server with the port to verify the network connection.

  • Ensure the server name you are connecting to is correct.
  • Check that your own firewall allows your connection across the internet to the instance.

Typically if it was the Azure firewall side, it would prompt you to add your IP to the firewall rules, provided the account we are trying for connecting with is an admin account.

SQL Server Error Code and solution summary

SQL Server Error: 10060
Severity: 0
Event Logged or not: No
Description:
An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)

Make Sure a firewall rule for exemption on the client and also firewall rule for exemption in Azure SQL Database to allow the client IP address/subnet.

Generally our MySQL client experience error 10060 while trying to MySQL server over AWS cloud.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related AWS queries.

In this context, we shall look into methods to resolve the error «RDS: ERROR 2003 (HY000): Can’t connect to MySQL server (10060)».

Nature of AWS MySQL error 10060 ?

The error message MySQL server sends back is:

"RDS: ERROR 2003 (HY000): Can't connect to MySQL server (10060)".
  • It states that the inbound/outbound traffic from the AWS instance is not reachable to the current host where we run the MySQL client.
  • So we need to register the public IP address in the RDS security groups to get access over the RDS MySQL instance.

How to fix AWS MySQL error 10060 ?

1. Configure public IP address in security groups

i. First and foremost we need to find the public IP address for the host machine where we run mysql-client. If we use the Amazon EC2 instance we can find the public IP here.

ii. Here, we go to the security groups and add the public IP address for inbound traffic.

iii. Then we add the same entry for outbound traffic by AWS services.

iv. Once done, we refresh the security groups and test the connection from any mysql-client.

For example, to test the connection we run the below command from any terminal where MySQL is configured:

mysql -h host-public-ip/DNS -P 3306 -u username -p password

2. Network ACLs

Network ACLs act as a firewall for resources in a specific subnet in a VPC. If we have ACLs, we ensure they have rules that allow all traffic to and from the DB instance.

i. Create a network ACL

We can create a custom network ACL. By default, a network ACL that we create blocks all traffic until we add rules:

  • Initially, we open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  • In the navigation pane, we choose Network ACLs.
  • Then we choose Create Network ACL.
  • In the Create Network ACL dialog box, optionally name the network ACL, and select the ID of the VPC from the VPC list.
  • Then we choose Yes > Create.

How to Add and delete rules from a network ACL ?

If we add or delete a rule from an ACL, any subnets that associate with it are subject to change. We don’t have to terminate and relaunch the instances in the subnet. The changes take effect after a short period.

On the other hand, if we use the Amazon EC2 API or a command-line tool, we can’t modify rules. Here, we can only add and delete rules.

With the Amazon VPC console, we can modify the entries for existing rules. On our behalf, the console removes the existing rule and adds a new rule.

In order to change a rule in the ACL, we must add a new rule with the new rule number, and then delete the original rule.

i. Add rules:

  • Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  • In the navigation pane, we choose Network ACLs.
  • Then in the details pane, we choose either the Inbound Rules or Outbound Rules, then choose Edit.
  • In Rule #, we enter a rule number (for example, 100). The rule number must not already be in use in the network ACL.
  • We recommend leaving gaps between the rule numbers because it makes it easier to add a new rule without having to renumber the existing rules.
  • We select a rule from the Type list. For example, to add a rule for HTTP, choose HTTP. To use a protocol, not on the list, we choose Custom Protocol Rule.
  • In case of a custom protocol rule, select the protocol’s number and name from the Protocol list.
  • Then in the Source or Destination field, we enter the CIDR range that the rule applies to.
  • From the Allow/Deny list, we select ALLOW to allow traffic or DENY to deny traffic.
  • In case we want to add another rule, we select Add another rule and repeat steps 4 to 9 as required.
  • Once done, choose Save.

ii. Delete a rule:

  • We open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
  • In the navigation pane, we choose Network ACLs and select the network ACL.
  • In the details pane, select either the Inbound Rules or Outbound Rules tab, and then choose Edit.
  • We can select Remove for the rule we want to delete, and then Save.

[Need help with fixing MySQL errors? We can help you. ]

I am getting below error while trying to connect my instance.

An error has occurred while establishing a connection to the server. When connecting to SQL Server, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 — A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)`

I am using Microsoft SQL Server 2008 R2.

Thanks in advance.

Zayn Ali's user avatar

Zayn Ali

4,7651 gold badge30 silver badges40 bronze badges

asked Aug 4, 2017 at 4:08

Hemant Sarraf's user avatar

2

To configure SQL Server 2005 to allow remote connections, you must complete these steps:

  1. Enable remote connections on the instance of SQL Server that you
    want to connect to from a remote computer.
  2. List item Turn on the SQL Server Browser service.

Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.

You have to enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:

  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
  2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
  3. On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

Note Click OK when you receive the following message:
Changes to Connection Settings will not take effect until you restart the Database Engine service.

On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

answered Aug 4, 2017 at 4:16

Tripurari Yadav's user avatar

Tripurari YadavTripurari Yadav

2161 gold badge3 silver badges11 bronze badges

1

Perhaps..

  • The server is powered off
  • Sqlserver is not running
  • Sqlserver is running on a different port to the default
  • Sqlserver is not configured to accept tcp connections (see tripuri’s answer)
  • An interim firewall, or windows firewall is blocking the connection
  • There is an interim network failure between your machine and the server
  • You’re running it locally and your recent version of windows is prohibiting loopback connections

answered Aug 4, 2017 at 4:16

Caius Jard's user avatar

Caius JardCaius Jard

72.6k5 gold badges49 silver badges81 bronze badges

The other answers seem to ignore the fact that this is on RDS. A couple of items to check.

  1. Is the security group opened to allow traffic to the RDS instance?
  2. Where is the client that you’re trying to connect from?
  3. Have you ever been able to connect to it?
  4. Please provide details of your network and VPC configuration.

I suspect the issue is in the security group and/or issues with the VPC configuration.

answered Aug 4, 2017 at 4:42

BryceH's user avatar

BryceHBryceH

2,7502 gold badges21 silver badges24 bronze badges

We often used to access MySQL remotely, in some cases, it won’t allow us to connect remotely. It may throw an error by saying

“Cannot connect to MySQL server (10060)”

There are more reasons to cross-check such as downtime in MySQL service and restrictions on the firewall. If the host connection responds at a specific time, you won’t get an error in connecting MySQL remotely.

Downtime in service: This is the most common reason why the user tries to connect MySQL during its downtime. It may be of few problems in MySQL such as DDoS attacks, outages in resources, and heavy traffic spikes.

Let’s start to fix this problem immediately:

Please take confirmation on the server running with the netstat command:

Code:

netstat -plan | grep :3306

If you didn’t get a response or server, get a failure, the dead process will be killed and again it tries to restart the service. For downtime, check the error that occurs in server logs and sort out the problem.

Issues in MySQL configuration:

Only from the localhost, does MySQL responds to the connection.

bind-address 127.0.0.1

With the help of localhost, MySQL will receive the error.

Go to /etc/MySQL/my.cnf configuration file and check whether there is an option to access the remote control.

If you didn’t find the remote enablement, just change the value bind-address to 0.0.0.0 only so, that you will get connected to all the connections.

bind-address 0.0.0.0

You can even set the parameter value for bind-address to make remote access. There is a chance for MySQL listen to the service:

bind-address database-IP

Once you run this command, MySQL starts to listen to the IP address of the server. So, to confirm the changes do MySQL service restart.

Before making any changes, kindly take a backup without fail. If something gets terrible, this backup will help you a lot.

Restrictions in Firewall:You might have checked the firewall open port 3306 hasn’t opened. So, you won’t get connected to other connections outright!

To confirm the failure of a connection in the remote, check it’s only because of the firewall. Just disable the firewall and try to connect again. For cross-checking external connectivity, use command telnet in /etc/mysql/my.cnf :

telnet xx.xx.xx.xx 3306

In case, if you get any connectivity interference from the firewall, making changes in settings can help you.

Windows users:

Step 1:

Tap on the start button and select the control panel to choose “system & security”.

Step 2: Now, select “Windows Firewall” and then “Exception”.

Step 3: You can add the port now.

Ubuntu users:

Use the command to open the MySQL port: ufw allow 3306

Remote users won’t have privileges:

First of all, a remote user should have permission to access MySQL.

Code:

GRANT ALL ON *.* to 'user'@'host_name' identified by 'Password';
FLUSH PRIVILEGES;

Root users have so many privileges to access MySQL. So, as a root user, the server of MySQL leaves a way for you to connect remotely.

To whitelist the IP address or remote host, go to cPanel and then choose “database” to select “remote MySQL”

MySQL connection string entered wrongly:

With the MySQL connection string, you can connect to the MySQL server. In case, if the string was wrong of course, you will get the error right! Your whole connection may get blocked by port, username, database name, and server name if entered wrongly.

The client can give full details on a string. Start configuring the ODBC to the server for comparing the new one with the old string. If the result is matched, your connection will be easy in remote, or else you will get an error.

Try to resolve the matching condition for the strings.

Your problem will be solved!

Понравилась статья? Поделить с друзьями:
  • Ошибка p3282 мерседес
  • Ошибка stop 116
  • Ошибка smtp не удалось пройти авторизацию joomla
  • Ошибка spotify нет интернета
  • Ошибка p3249 камаз