Fix MySQL Error: Got a packet bigger than ' Max_allowed_packet ' bytes

Source: Internet
Author: User

Mysql 5.1 started to encounter a large packet problem, when importing data with the client, encountered error code: 1153-got apacket bigger than ' Max_allowed_packet ' bytes, the database terminated the operation of data import.

Cause analysis: MySQL limits the maximum data value for each insert operation, exceeding the maximum value to report the above error.

After-depth study found:

Both the database client and the database server terminal have their own max_allowed_packet variables, so if you intend to handle large packets, you must increase the value of the variable configuration on the client and server.

In general, the server default max-allowed-packet is 1MB, the client's max-allowed-packet is 16MB.

The MySQL side modifies the max-allowed-packet values by:

Add the Max_allowed_packet attribute to the MySQL configuration file My.ini:

Note that it must be added under [mysqld]-;

Finally, then restart MySQL. Whether the test succeeded =========================================================================== Select the database F6 in the Navacat or right-click into the console command mode to enter the code "note to the end of the semicolon"; show VARIABLES like '%max_allowed_packet% '; test success;

Fix MySQL Error: Got a packet bigger than ' Max_allowed_packet ' bytes

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.