MySQL Client common error Summary

Source: Internet
Author: User
Tags mysql client connection reset

MySQL Client Connection server, client report corresponding error number summary:

1. Error 104

[Email protected]:~ $perror 104

OS error code 104:connection reset by peer

This is because the server side backlog is full.

2. Error 110

[Email protected]:~ $perror 110

OS error code 110:connection timed out

This is caused by a timeout when connecting to the server side. The timeout exceeds the client time out.

3. Error 111

[Email protected]:~ $perror 111

OS error code 111:connection refused

This is the server-side connection, rejected by the server connection, indicating that the port is not in the listening state, or that the port is not open caused.

4. Error 4

[Email protected]:~ $perror 4

OS errorcode 4:interrupted System call

In this note, the client initiates the first TCP packet (SYN packet) and does not get a response within the time set by the client. The client is disconnected from the OS without exceeding the timeout time of the client (there are other reasons, such as the fact that the file handle is not enough to be disconnected by the OS).

Key Notes under Error 4

[Email protected]:~ $mysql-hlongxibendi-cd-pa-abcd00-p3309--connect-time=5

ERROR 2003 (HY000): Can ' t connect to MySQL server on ' longxibendi-cd-pa-abcd00 ' (4)

[Email protected]:~ $time mysql-hlongxibendi-cd-pa-abcd00-p3306--connect-time=8

ERROR 2003 (HY000): Can ' t connect to MySQL server on ' longxibendi-cd-pa-abcd00 ' (4)

Real 0m8.006s

User 0m0.004s

SYS 0m0.001s

[Email protected]:~ $mysql-hlongxibendi-cd-pa-abcd00-p3309--connect-time=10

ERROR (HY000): Lost connection to MySQL server at ' readinginitial Communication packet ', System error:110

The client connects to the server, the number of connection retries, depending on the/proc/sys/net/ipv4/tcp_syn_retries parameter (the server being tested, the parameter =1)

In this way, the client initiates the connection for the first time, lasts 3s, does not succeed, retries for the first time, lasts 6s, and, if unsuccessful, is disconnected by the OS.

Therefore, in the two test set to Connect-time=5, 8s, because the first retry, retry is not completed, but more than connect-time time, the client is disconnected from the OS. (because at least 9s is required to complete the first retry, and Connect-time is less than 9s). Therefore, the error 4 is reported.

In a test set to connect-time=10s, the client initiates a connection for the first time, lasts 3s, does not succeed, retries for the first time, retries, does not succeed, arrives at connect-time time, and the client disconnects. Therefore, the error 110 is reported.

In summary, assume that the value of/proc/sys/net/ipv4/tcp_syn_retries is n

Then, when the TCP initiates the connection, the SYN packet is sent first, and then the interval rule is retried before the connect-time is exceeded.

3s 6s 12s 24s 48s

0 times 1th 2nd 3rd times 4th Times

No. 0 time, send SYN packet, continuous 3s response, if not, retry 1th time, send SYN packet, continuous 6s, if not retry 2nd, send SYN packet, continuous 12s, and so on

The total time spent is:

Transmission time + interval = transmission time + 3*[1* (1-2n)/(1-2) + 2 n]=3 (2n+1-1) + Transfer time

Because the transmission time is basically 0s

So omit the transfer time, the total time spent is about 3 (2n+1-1) seconds

MySQL Client common error Summary

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.