Wishlist 0 ¥0.00

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

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

  1. set global max_allowed_packet=100 000 000;   
  2.   
  3. set global net_buffer_length=100000;   
  4.   
  5. SET GLOBAL  interactive_timeout=28800 000;  
  6.   
  7. SET GLOBAL  wait_timeout=28800000  
以上语句的解释:

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

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

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

wait_timeout 对当前交互链接有效;

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

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

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.