Home > Database > Mysql Tutorial > mysql导入sql文件过大或连接超时的解决办法_MySQL

mysql导入sql文件过大或连接超时的解决办法_MySQL

WBOY
Release: 2016-06-01 13:03:59
Original
922 people have browsed it

前段时间出差在现场开发的时候,导入数据库老是出问题。最后发现了一个神奇sql语句交给实施,只要导入出错就把如下语句执行就可以了。至今屡试不爽。

set global max_allowed_packet=100 000 000; 

set global net_buffer_length=100000; 

SET GLOBAL  interactive_timeout=28800 000;

SET GLOBAL  wait_timeout=28800000
Copy after login
以上语句的解释:

–max_allowed_packet=XXX 客户端/服务器之间通信的缓存区的最大大小;

–net_buffer_length=XXX TCP/IP和套接字通信缓冲区大小,创建长度达net_buffer_length的行

interactive_timeout = 10; 对后续起的交互链接有效;

wait_timeout 对当前交互链接有效;

=============================================

以上语句主要解决:连接超时,导入的sql文件过大。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template