mysql 的最大查询大小是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16335011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is maximum query size for mysql?
提问by Hemal Kachhadiya
What is maximum query size for mysql? Some times the server stops working when I fire a too long query.
mysql 的最大查询大小是多少?有时,当我触发过长的查询时,服务器会停止工作。
回答by kiriloff
You can check your current server setting with:
您可以通过以下方式检查您当前的服务器设置:
SHOW VARIABLES LIKE 'max_allowed_packet';
This gives you the answer in bytes. for e.g max_allowed_packet=1048576
or 1mb
这为您提供了以字节为单位的答案。例如max_allowed_packet=1048576
或1mb
回答by Hemal Kachhadiya
To increase the max_allowed_packet
, open
要增加max_allowed_packet
, 打开
my.ini/my.cnf
under [mysqld]
section.
my.ini/my.cnf
[mysqld]
节下。
Once the change is done you would have to restart the server.
更改完成后,您必须重新启动服务器。