What to do with MySQL server has gone away error in Navicat

Source: Internet
Author: User

Today back up the data on this site, the resulting SQL file is relatively large, of course, this SQL contains more redundant data. With Navicat direct import words, error MySQL server has gone away. As shown in the following illustration:

Solutions

Open the tools in the Navicat menu, select Server Monitor, then select the database in the left column, click the variable table item in the right column, look for the max_allowed_packet, and change the value.

After the

is modified, import the backed up SQL file again, and everything is OK.

If it is still unresolved, I have sorted out some MySQL queries to encounter the MySQL server has gone away problem

To find your MySQL directory my.ini configuration file, add the following code:

Max_al lowed_packet=500m

wait_timeout=288000

Interactive_timeout = 288000

Change the value of the situation myself, I directly change the number, and finally remember to restart your My SQL Services

This is a good solution to the MySQL server has gone away problem. Max_allowed_packet is MySQL allows the largest packet, that is, the request you send, Wait_timeout is the longest waiting time, this value can be customized, but if the time is too short, after the timeout will be the MySQL server has gone Away #2006错误. The function of the Max_allowed_packet parameter is to control the maximum length of its communication buffer

If you do not modify the MYQL permissions we can in the PHP program, if php.ini modified not convenient, you can try to solve the following code.

Ini_set (' Mysql.connect_timeout ', 300);
 
Ini_set (' default_socket_timeout '),
 
After Ini_set, you can use Ini_get to verify that the parameter settings are appropriate for your expectations.

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.