Solution to Lost connection to MySQL server during query error

Source: Internet
Author: User

When I used Navicat for MySQL to import a MySQL database yesterday, a serious error occurred. Lost connection to MySQL server during query, literally, Lost connection to the MySQL server during the query.

[Msg] Decompressing...
[Msg] Table Created: wp_wiki_copy
[Msg] Importing Data...
[Msg] 2013-Lost connection to MySQL server during query
[Msg] Table Restored: wp_wiki_copy
[Msg] Finished-Stopped before completion

I have about 50 thousand data records and the size of the backup database file is 240 mb, which is compressed and indeed a little large.

It was preliminarily determined that MySQL may have crashed and the MySQL process was not stopped in the system service.

At first, the database structure was incorrect, but I used Navicat for MySQL to back up and restore the imported data. The table structure should be in the backup file and should not be a problem with the database structure.

The network environment is local. It cannot be a problem with network connections or database servers.

Finally, the solution is found in the morning, and added under the mysqld node in the my. ini configuration file

Max_allowed_packet = 500 M

That is, to configure the maximum data packet size allowed by MySQL, you can modify the data packet size as per your project, as long as it is larger than the backup file to be imported.

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: 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.