MySQL import times wrong: Got a packet bigger than ' Max_allowed_packet ' bytes

Source: Internet
Author: User

The reason is that the Max_allowed_packet value is set too small.

There are two ways to say it online:

method One , directly modify MY.CNF (Linux) or My.ini (Windows) files, for example:

max_allowed_packet=10m

Then restart the MySQL service. But I can't do it after I try, and the reason is unclear.

method Two , through the MySQL own client (black box interface), through the command to see the current size of the Max_allowed_packet value:

  

 like ' %max_allowed_packet% ';

The unit of the value to be detected is a byte (byte)

Set the default unit is also a byte, such as you want to set to 100M, then should be 100*1024*1024, the execution of the modified command is:

  

Set =  - * 1024x768 * 1024x768

After the modification, you need to close the cmd window and reopen it again to see the new value after the change, otherwise you will see the original value (cache).

PS: The specific how much, need to depend on the specific circumstances, may be modified, or reported the same error, it doesn't matter, then set the larger. I have more than 4 G of SQL file, finally set Max_allowed_packet to 1G (i.e., 1024*1024*1024)

MySQL import times wrong: Got a packet bigger than ' Max_allowed_packet ' bytes

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.