How to correctly understand MySQL communication error and failure connection

Source: Internet
Author: User
Tags log server error log

For connection problems, the server error log is a useful source of information. If the server was started with the "--log-warnings" option, the following message may be found in the error log:

010301 14:38:23 Aborted connection 854 to db: 'users' user: 'josh'

If the "Aborted connections" (Abort connection) message appears in the error log, the possible causes are:

1. The client program did not invoke Mysql_close () before exiting.

2. The client's idle time exceeds wait_timeout or interactive_timeout seconds, and no requests are made to the server.

3. The client ends abruptly in the middle of data transfer.

When such a situation occurs, the server increases the "aborted_clients" (discard client) state variable.

The server will increase the "aborted_clients" (discard client) state variable when the following conditions occur.

• The client does not have permission to connect to the database.

• The client is using an incorrect password.

• The connection information package does not contain the correct information.

• The time to get the connection packet exceeds connect_timeout seconds.

If this happens, it may indicate that someone is trying to hack into your server!

Other possible sources for discarding the client or abandoning the connection problem include:

• Use Ethernet protocol with Linux, Half-duplex or Full-duplex. Many Linux Ethernet drivers have this flaw. You should test the flaw by transferring large files between the client and server machines through FTP. If the transmission is in Burst-pause-burst-pause (Burst-suspend-break-pause) mode, you are experiencing a Linux duplex failure. The only workaround is to switch the duplex mode of the NIC and hub/to Full-duplex or Half-duplex, and test the results to determine the best setting.

• Some issues related to line threading cause read interrupts.

• Poorly configured TCP/IP.

• Problematic Ethernet, hub, exchanger, cable, etc. Can only be properly diagnosed by replacing the hardware.

• Variable max_allowed_packet is too small or the query requires more memory than is allocated for mysqld.

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.