MySQL database when importing SQL file "Error code:1153-got a packet bigger than ' Max_allowed_packet ' bytes ' workaround

Source: Internet
Author: User
Tags error code

When importing SQL files into the MySQL database, if the file is too large (hundreds of m), you will be prompted "Error code:1153-got a packet bigger than ' Max_allowed_packet ' bytes"

1. View Current Database configuration

Show VARIABLES like '%max_allowed_packet% ';

Displays the following results

+--------------------+---------+

| variable_name | Value |+--------------------+---------+| Max_allowed_packet | 1048576 |+--------------------+---------+ Description The current configuration is: 1048576/1024/1024 = 1M 2. Modify the "Max_allowed_packet" in the My.ini file The value path is in the MySQL installation directory

3. After the change, restart the MySQL service

In the cmd window, execute the net stop MySQL first, and then the net start MySQL

Then go to SQLyog to execute show VARIABLES like '%max_allowed_packet% '; Discovery value changed

MySQL database when importing SQL file "Error code:1153-got a packet bigger than ' Max_allowed_packet ' bytes ' workaround

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.