mysql 2006
1.在my.ini文件中添加或者修改以下两个变量:
wait_timeout=2880000
interactive_timeout = 2880000
关于两个变量的具体说明可以google或者看官方手册。
如果不能修改my.cnf,则可以在连接数据库的时候设置CLIENT_INTERACTIVE,比如:
sql = "set interactive_timeout=24*3600";
mysql_real_query(...)
2.执行一个SQL,但SQL语句过大或者语句中含有BLOB或者longblob字段。
比如,图片数据的处理
解决方案
在my.cnf文件中添加或者修改以下变量:
max_allowed_packet = 10M (也可以设置自己需要的大小)
max_allowed_packet 参数的作用是,用来控制其通信缓冲区的最大长度。
17.4.1.20 Replication and max_allowed_packet
max_allowed_packet
sets an upper limit on the size of any single message between the MySQL server and clients, including replication slaves. If you are replicating large column values (such as might be found in TEXT
orBLOB
columns) and max_allowed_packet
is too small on the master, the master fails with an error, and the slave shuts down the I/O thread. If max_allowed_packet
is too small on the slave, this also causes the slave to stop the I/O thread.
Row-based replication currently sends all columns and column values for updated rows from the master to the slave, including values of columns that were not actually changed by the update. This means that, when you are replicating large column values using row-based replication, you must take care to set max_allowed_packet
large enough to accommodate the largest row in any table to be replicated, even if you are replicating updates only, or you are inserting only relatively small values.
参考资料:
http://dev.mysql.com/doc/refman/5.5/en/replication-features-max-allowed-packet.html
http://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away
mysql 2006的更多相关文章
- MySQL 2006 超时
http://ronaldbradford.com/blog/sqlstatehy000-general-error-2006-mysql-server-has-gone-away-2013-01-0 ...
- mysql 2006错误 导入时
导入数据库报此错误 1.找到my.ini (免安装版的是由于你自己创建的) (安装版的在 C:\ProgramData\MySQL\MySQL Server 8.0 你安装的盘位置) 2.修改参数 ...
- mysql 2006 go away 错误
https://blog.csdn.net/yypsober/article/details/71330673 原文地址.
- 使用mysql的长连接
有个资料看得我云里雾里的.现在用自己的言语来总结一下,写文字,能够加深自己的理解.也会在写的过程中帮助自己发现理解方面瑕疵,继续查资料求证. 短链接的缺点:创建一个连接,程序执行完毕后,就会自动断掉与 ...
- mysql高可用架构 -> MHA简介-01
作者简介 松信嘉範:MySQL/Linux专家2001年索尼公司入职2001年开始使用oracle2004年开始使用MySQL2006年9月-2010年8月MySQL从事顾问2010年-2012年 D ...
- mysql的MHA高可用
一.MHA简介 作者简介 松信嘉範: MySQL/Linux专家 2001年索尼公司入职 2001年开始使用oracle 2004年开始使用MySQL 2006年9月-2010年8月MySQL从事顾问 ...
- Linux实战教学笔记39:Mha-Atlas-MySQL高可用方案实践(一)
一,mysql-mha环境准备 1.1 实验环境: 主机名 IP地址(NAT) 描述 mysql-db01 eth0:192.168.0.51 系统:CentOS6.5(6.x都可以) 安装:mysq ...
- Mha-Atlas-MySQL高可用方案实践
一,mysql-mha环境准备 1.1 实验环境: 1.1 实验环境: 主机名 IP地址(NAT) 描述 mysql-master eth0:10.1.1.154 系统:CentOS6.5(6.x都可 ...
- 第十一章· MHA高可用及读写分离
一.MHA简介 1.1.作者简介 松信嘉範: MySQL/Linux专家 2001年索尼公司入职 2001年开始使用oracle 2004年开始使用MySQL 2006年9月-2010年8月MySQL ...
随机推荐
- ExecutorService(转)
ExecutorService 建立多线程的步骤: 1.定义线程类 class Handler implements Runnable{ } 2.建立ExecutorService线程池 Execut ...
- MySQLdb安装和使用2
http://blog.chinaunix.net/uid-8487640-id-3183185.html MySQLdb是Python连接MySQL的模块,下面介绍一下源码方式安装MySQLdb: ...
- Linux下安装、配置、授权、调优Mysql
以前在linux已经安装了很多次的Mysql,但是时间间隔长了以后,安装步骤总是会遗漏,趁这次安装,做一下安装记录. 检查系统是否已经安装Mysql rpm -qa|grep -i mysql Mys ...
- 插件使用总结-jquery.pin.js
小伙伴们,俺昨天用了jquery.pin.js这个插件,发现了一些自以为是的使用问题.特此做个总结哈. 1.获取: 下载地址: http://www.bootcss.com/p/jquery.pin ...
- php 计算代码行数
<?php header("Content-type:text/html;charset=utf-8"); // php 递归计算文件夹代码行数 function codeL ...
- Sqlserver 列转行 行转列
sqlserver的行转列 列转行问题 行转列:1 使用Case when 方式 CREATE TABLE [StudentScores]( [UserName] NVARCHAR(20), --学生 ...
- SQL分页语句总结
今天对分页语句做一个简单的总结,他们大同小异的,只要理解其中一个其他的就很好理解了. 使用top选项 selecttop10*from Orders a where a.orderid notin(s ...
- Angularjs总结(七) 路由及请求服务等
define(['angular'], function (ng) { 'use strict'; var app = ng.module('index-module', ['ngCookies', ...
- Oracle11g服务及实例
1Orcl服务说明 1) Oracle ORCL VSS Writer Service:Oracle卷映射拷贝写入服务,VSS(Volume Shadow Copy Service)能够让存储基础设备 ...
- 【转】.Net中通过反射技术的应用----插件程序的开发入门
转自:http://www.cnblogs.com/winloa/archive/2012/03/25/2416355.html .Net中通过反射技术的应用----插件程序的开发入门 再开始之前,先 ...