Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a DB which is greater than 1GB (~1,4GB). The DB upload was stopped at 1GB, because, max_allowed_packet is 1073741824 (1GB). In file /etc/my.conf i set max_allowed_packet=2048M.

How can I increase max_allowed_packet 1073741824 to bigger?

Thank You!

share|improve this question
Please clarify what did you mean by 'DB upload' – Sergei Dec 27 '11 at 17:17
Hello, how and where you uploading the db and what os you are using? – Mughil Dec 27 '11 at 17:29

Bad News

The maximum value for max_allowed_packet is 1G or 1024M.

Even if you set it higher, MySQL will not load data beyond the 1GB limit.

Good News

The MySQL Packet is for processing rows, especially in bulk. The smaller the TEXT/BLOB fields you have in your tables, the more robust the MySQL Packet will be used. So that you can be more confident in its usage, here is an explanation of just what a MySQL Packet is:

According to the page 99 of "Understanding MySQL Internals" (ISBN 0-596-00957-7), here are paragraphs 1-3 explaining it:

MySQL network communication code was written under the assumption that queries are always reasonably short, and therefore can be sent to and processed by the server in one chunk, which is called a packet in MySQL terminology. The server allocates the memory for a temporary buffer to store the packet, and it requests enough to fit it entirely. This architecture requires a precaution to avoid having the server run out of memory---a cap on the size of the packet, which this option accomplishes.

The code of interest in relation to this option is found in sql/ Take a look at my_net_read(), then follow the call to my_real_read() and pay particular attention to net_realloc().

This variable also limits the length of a result of many string functons. See sql/ and sql/ for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.