MySQL 中 group_concat_max_len 的最大允许值是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26553823/
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 the maximum allowance for group_concat_max_len in MySQL?
提问by user3422637
I am using a group_concat to concatenate a lot of rows into one.
我正在使用 group_concat 将很多行连接成一个。
I set group concat to 10000 using:
我使用以下方法将组 concat 设置为 10000:
SET group_concat_max_len = 10000;
But even then, my output cells remain incomplete and end with ...
但即便如此,我的输出单元格仍然不完整,并以......
I tried setting group_concat_max_len = 20000 and even that didn't help.
我尝试设置 group_concat_max_len = 20000 ,即使这样也无济于事。
I also tried setting group_concat_max_len to 99999999. It still doesn't complete my output text. And I checked one of the group concat stops at Length = 230 characters and then gives ...
我还尝试将 group_concat_max_len 设置为 99999999。它仍然没有完成我的输出文本。我检查了一个组 concat 在 Length = 230 个字符处停止,然后给出...
Is there any other way?
有没有其他办法?
回答by Bill Karwin
Check out this link: https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_group_concat_max_len
查看此链接:https: //dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_group_concat_max_len
All the MySQL configuration variables are documented on that page, with details like minimum, maximum, default value, whether you can set them globally or per-session, whether you can change them on a running instance or does it require a restart, and other description of usage.
该页面上记录了所有 MySQL 配置变量,包括最小值、最大值、默认值等详细信息,是否可以全局设置或按会话设置它们,是否可以在正在运行的实例上更改它们或是否需要重新启动,以及其他使用说明。
The maximum value for group_concat_max_len
is 18446744073709551615.
的最大值为group_concat_max_len
18446744073709551615。
The group-concat string does not end with "..." If you try to group too much text, it just gets truncated. So I wonder if the problem is not with MySQL's settings, but with the display of your cells.
group-concat 字符串不以“...”结尾 如果您尝试对太多文本进行分组,它只会被截断。所以我想知道问题是否不在于 MySQL 的设置,而在于单元格的显示。
回答by Justin Levene
For 32bit systems, the maximum value is 4294967295
对于 32 位系统,最大值为 4294967295
For 64 bit systems, the maximum value is 18446744073709551615.
对于 64 位系统,最大值为 18446744073709551615。
You can set the variable for your current session using
您可以使用设置当前会话的变量
SET SESSION group_concat_max_len=4294967295;
To set the variable forever use
设置变量永远使用
SET GLOBAL group_concat_max_len=4294967295;
(see http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_group_concat_max_len)
(见http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_group_concat_max_len)