Common Errors When Using MySQL Programs
2954
You can get more information about the lost connections by starting
mysqld
with the
--log-
warnings=2
[414]
option. This logs some of the disconnected errors in the
hostname.err
file. See
Section 5.2.1, “The Error Log”
.
If you want to create a bug report regarding this problem, be sure that you include the following
information:
• Indicate whether the MySQL server died. You can find information about this in the server error log.
See
Section C.5.4.2, “What to Do If MySQL Keeps Crashing”
.
• If a specific query kills
mysqld
and the tables involved were checked with
CHECK TABLE
before
you ran the query, can you provide a reproducible test case? See
MySQL Internals: Porting to Other
Systems
.
• What is the value of the
wait_timeout
[506]
system variable in the MySQL server? (
mysqladmin
variables
gives you the value of this variable.)
• Have you tried to run
mysqld
with the general query log enabled to determine whether the problem
query appears in the log? (See
Section 5.2.2, “The General Query Log”
.)
See also
Section C.5.2.11, “Communication Errors and Aborted Connections”
, and
Section 1.7, “How
to Report Bugs or Problems”
.
C.5.2.10. Packet Too Large
A communication packet is a single SQL statement sent to the MySQL server, a single row that is sent
to the client, or a binary log event sent from a master replication server to a slave.
The largest possible packet that can be transmitted to or from a MySQL 5.0 server or client is 1GB.
When a MySQL client or the
mysqld
server receives a packet bigger than
max_allowed_packet
[466]
bytes, it issues an
ER_NET_PACKET_TOO_LARGE
[2920]
error and
closes the connection. With some clients, you may also get a
Lost connection to MySQL
server during query
error if the communication packet is too large.
Both the client and the server have their own
max_allowed_packet
[466]
variable, so if you want to
handle big packets, you must increase this variable both in the client and in the server.
If you are using the
mysql
client program, its default
max_allowed_packet
[466]
variable is 16MB.
To set a larger value, start
mysql
like this:
shell>
mysql --max_allowed_packet=32M
That sets the packet size to 32MB.
The server's default
max_allowed_packet
[466]
value is 1MB. You can increase this if the server
needs to handle big queries (for example, if you are working with big
BLOB
columns). For example, to
set the variable to 16MB, start the server like this:
shell>
mysqld --max_allowed_packet=16M
You can also use an option file to set
max_allowed_packet
[466]
. For example, to set the size for
the server to 16MB, add the following lines in an option file:
[mysqld]
max_allowed_packet=16M
It is safe to increase the value of this variable because the extra memory is allocated only when
needed. For example,
mysqld
allocates more memory only when you issue a long query or when
mysqld
must return a large result row. The small default value of the variable is a precaution to catch
incorrect packets between the client and server and also to ensure that you do not run out of memory
by using large packets accidentally.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...