What is the maximum allowance for group_concat_max_len in MySQL?

后端 未结 2 522
悲哀的现实
悲哀的现实 2020-12-15 18:29

I am using a group_concat to concatenate a lot of rows into one.

I set group concat to 10000 using:

SET group_concat_max_len = 10000;
相关标签:
2条回答
  • 2020-12-15 18:52

    Check out this link: 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.

    The maximum value for group_concat_max_len is 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.

    0 讨论(0)
  • 2020-12-15 18:58

    For 32bit systems, the maximum value is 4294967295

    For 64 bit systems, the maximum value is 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)

    0 讨论(0)
提交回复
热议问题