MySQL import large SQL file error Max_allowed_packet

Source: Internet
Author: User
Tags mysql command line mysql import

1. View the current maximum allowable import SQL file size

Show VARIABLES like '%max_allowed_packet% ';

  

2. How to Modify

1. Permanent entry into force

Modify the My.cnf file

VIM/ETC/MY.CNF (if not found using: MySQL--help | grep my.cnf)

    

2. Temporary entry into force

Run in the MySQL command line

Set Global Max_allowed_packet = 2*1024*1024*10 exit the MySQL command line and log back in.    Show VARIABLES like '%max_allowed_packet% '; See if the next Max_allowed_packet is edited successfully
Note: In method 2, if the MySQL service is restarted, the value of Max_allowed_packet is restored to the default initial value, and the value set on the command line does not take effect.

3. After restarting the MySQL server, this parameter will take effect

MySQL import large SQL file error Max_allowed_packet

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.