Thursday, January 7, 2016

MySQL group_concat is causing trouble in getting output

Hello,

I was trying to get a long list of IDs against some value together by using group_concet comnad but there was some issue as the list I was getting was incomplete and every time I executed the command some values were missing.

I Googled for this issue and found that there is a MySQL session variable named group_concat_max_len which has a limit enforced by default to 1024, and it will not let anything beyond the enforced limit.

So, simple solution was to increase this limit to suit my need,

the command is I used is following:

SET SESSION group_concat_max_len = 1000000;

This needs to be executed for every MySQL session or needed to be declared in my.ini file for permanent usage.

Tested it works like a charm.

Thanx
Anshumaan Bakshi


No comments:

Post a Comment