description:
remember that your MySQL "max_allowed_packet" configuration setting (default 1MB)
mysql 默认最大能够处理的是1MB
如果你在sql使用了大的text或者BLOB数据,就会出现这个问题。 php手册上的注释
When trying to INSERT or UPDATE and trying to put a large amount of text or data (blob) into a mysql table you might run into problems.
In mysql.err you might see:
Packet too large (73904)
To fix you just have to start up mysql with the option -O max_allowed_packet=maxsize
You would just replace maxsize with the max size you want to insert, the default is 65536
mysql手册上说
Both the client and the server have their own max_allowed_packet variable, so if you want to handle big packets, you must increase this variable both in the client and in the server.
If you are using the mysql client program, its default max_allowed_packet variable is 16MB. To set a larger value, start mysql like this:
shell> mysql --max_allowed_packet=32M That sets the packet size to 32MB.
The server's default max_allowed_packet value is 1MB. You can increase this if the server needs to handle big queries (for example, if you are working with big BLOB columns). For example, to set the variable to 16MB, start the server like this:
shell> mysqld --max_allowed_packet=16M You can also use an option file to set max_allowed_packet. For example, to set the size for the server to 16MB, add the following lines in an option file:
[mysqld]max_allowed_packet=16M
使用mysql做数据库还原的时候,由于有些数据很大,会出现这样的错误:The MySQL Server returned this Error:MySQL Error Nr.2006-MySQL server has gone away。我的一个150mb的备份还原的时候就出现了这错误。解决的方法就是找到mysql安装目录,找到my.ini文件,在文件的最后添加:max_allowed_packet = 10M(也可以设置自己需要的大小)。 max_allowed_packet 参数的作用是,用来控制其通信缓冲区的最大长度。
分享到:
相关推荐
此文档中详细的记载了,MySQL server has gone away 问题的解决方法,希望可以帮助到你!
今天遇到类似的情景,MySQL只是冷冷的说:MySQL server has gone away。
MySQL导入sql脚本错误:2006 – MySQL server has gone away 到如一些小脚本很少报错,但最近导入一个10+M的SQL脚本,却重复报错: Error occured at:2014-03-24 11:42:24 Line no.:85 Error Code: 2006 - MySQL ...
在我们使用mysql导入大文件sql时可能会报MySQL server has gone away错误,该问题是max_allowed_packet配置的默认值设置太小,只需要相应调大该项的值之后再次导入便能成功。该项的作用是限制mysql服务端接收到的包...
主要介绍了gearman中worker常驻后台,导致MySQL server has gone away的解决方法,较为详细的分析了造成MySQL server has gone away的原因与相关的解决方法,需要的朋友可以参考下
解决办法是: 运行下面SQL 代码如下:USE master; GO DECLARE @SQL VARCHAR(MAX); SET @SQL=” SELECT @SQL=@SQL+’;... 您可能感兴趣的文章:MySQL server has gone away 问题的解决方法MySQL提示:The
MYSQL server has gone away 引起这个原因是不可怕的.原因是更改了系统的断开时间. mysql>show gloable variables like “%timeout%”; 进行查看 interactive_timeout 的黓认值为28800 wait_timeout 的默认值这:...
最全面的MySQL数据库的调优方法,欢迎大家下载!
若导入时报错,ERROR 2006 (HY000):MySQL server has gone away 。我们可以通过语句查看一下允许的最大包大小:show global variables like 'max_allowed_packet'; MySQL使用最大数据包站站点进行服务器和客户端...
Qt5.4下连接Mysql,QSqlDatabase: QMYSQL driver not loaded but available-附件资源
Django 自称是“最适合开发有限期的完美WEB框架”。本文参考《Django web开发指南》,快速搭建一个blog 出来,在中间涉及诸多知识点,这里不会详细说明,如果你是第一次接触Django ,本文会让你在感性上对Django有个...
基于tp5的swoole支持,对th5的connection进行改造,使用Swoole\Coroutine\MySQL重写了基于swoole的PDO接口,实现了mysql的数据库连接池,本地测试可用。使用时,替换thinkphp/library/think/db/Connection.php,并...
OperationalError: (2006, ‘MySQL server has gone away’) OperationalError: (2013, ‘Lost connection to MySQL server during query’) 查询mysql全局变量SHOW GLOBAL VARIABLES;可以看到wait_timeout,此变量...
ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... 这个报错信息就意味着当前的连接已经断开,需要重新建立连接。 那么,连接的时长是如何确认的? 其实,这个与interactive_...