Navicat MySQL server has gone away error what to do "reprint"

Source: Internet
Author: User
Tags mysql query

Reprint Link: http://www.111cn.net/database/mysql/64073.htm

MySQL database appears MySQL server has gone away error is generally caused by the SQL statement is too large, the following in the operation of the database using Navicat prompt MySQL server has gone away problem resolution.

When backing up data, the resulting SQL file is larger, and of course, this SQL contains much more redundant data. With Navicat direct import words, error MySQL server has gone away. As shown in the following:

Solutions

Open Tools in the Navicat menu, select Server Monitor, then select the database in the left column, click the variable form item in the right column, look for Max_allowed_packet, and change its value to large.

After the change, import the backup SQL file again, everything is OK.

If still unable to resolve, below I tidy up some MySQL query encountered MySQL server has gone away problem

Locate the My.ini configuration file in your MySQL directory and add the following code:

max_allowed_packet=500m

wait_timeout=288000

Interactive_timeout = 288000

I see the situation change the value, I directly changed a lot, finally remember to restart your MySQL service

This will be a good solution to the MySQL server has gone away problem. Max_allowed_packet is MySQL allows the largest packet, that is, you send the request, Wait_timeout is the longest time to wait, this value can be customized, but if the time is too short, after the timeout will be now 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 the php.ini is not convenient to modify, you can try to solve the following code.

Ini_set (' Mysql.connect_timeout ', 300);

Ini_set (' Default_socket_timeout ', 300);

After Ini_set, you can use Ini_get to verify that the parameter settings are appropriate for your expectations.

Navicat MySQL server has gone away error what to do "reprint"

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.