Common MYSQL Error – Communication Errors and Aborted Connections
The server error log can be a useful source of information about connection problems. See Section 5.2.2, “The Error Log”. If you start the server with the –log-warnings option, you might find messages like this in your error log:
010301 14:38:23 Aborted connection 854 to db: ‘users’ user: ‘josh’
If a client successfully connects but later disconnects improperly or is terminated, the server increments the Aborted_clients status variable, and logs an Aborted connection message to the error log. The cause can be any of the following:
The client program did not call mysql_close() before exiting.
The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server. “Server System Variables”.
The client program ended abruptly in the middle of a data transfer.
If a client is unable even to connect, the server increments the Aborted_connects status variable. Unsuccessful connect attempts can occur for the following reasons:
A client doesn’t have privileges to connect to a database.
A client uses an incorrect password.
A connection packet doesn’t contain the right information.
It takes more than connect_timeout seconds to get a connect packet. “Server System Variables”.
If these kinds of things happen, it might indicate that someone is trying to break into your server! Messages for these types of problems are logged to the general query log if it is enabled.
Other reasons for problems with aborted clients or aborted connections:
Use of Ethernet protocol with Linux, both half and full duplex. Many Linux Ethernet drivers have this bug. You should test for this bug by transferring a huge file using FTP between the client and server machines. If a transfer goes in burst-pause-burst-pause mode, you are experiencing a Linux duplex syndrome. The only solution is switching the duplex mode for both your network card and hub/switch to either full duplex or to half duplex and testing the results to determine the best setting.
Some problem with the thread library that causes interrupts on reads.
Badly configured TCP/IP.
Faulty Ethernets, hubs, switches, cables, and so forth. This can be diagnosed properly only by replacing hardware.
The max_allowed_packet variable value is too small or queries require more memory than you have allocated for mysqld. “Packet too large”.
What are MYSQL Errors?
MySQL programs have access to several types of error information when the server returns an error.
The MYSQL message displayed contains three types of information:
A numeric error code. This number is MySQL-specific and is not portable to other database systems.
A five-character SQLSTATE value. The values are specified by ANSI SQL and ODBC and are more standardized. Not all MySQL error numbers are mapped to SQLSTATE error codes.
A message string that provides a textual description of the error.
When an error occurs, you can access the MySQL error code, the SQLSTATE value, and the message string using C API functions:
MySQL error code: Call mysql_errno()
SQLSTATE value: Call mysql_sqlstate()
Error message: Call mysql_error()
Hope this was helpful.
Information about MYSQL Error Codes and Error Messages or Warnings on Windows, Linux Operating Systems.