group concat - MySQL and GROUP_CONCAT() maximum length

ID : 10412

viewed : 29

Tags : mysqlgroup-concatmysql

Top 5 Answer for group concat - MySQL and GROUP_CONCAT() maximum length

vote vote

91

SET SESSION group_concat_max_len = 1000000; 

is a temporary, session-scope, setting. It only applies to the current session You should use it like this.

SET SESSION group_concat_max_len = 1000000; select group_concat(column) from table group by column 

You can do this even in sharing hosting, but when you use an other session, you need to repeat the SET SESSION command.

vote vote

80

The correct parameter to set the maximum length is:

SET @@group_concat_max_len = value_numeric; 

value_numeric must be > 1024; by default the group_concat_max_len value is 1024.

vote vote

76

Include this setting in xampp my.ini configuration file:

[mysqld] group_concat_max_len = 1000000 

Then restart xampp mysql

vote vote

69

You can try this

SET GLOBAL group_concat_max_len = 1000000; 
vote vote

57

The correct syntax is mysql> SET @@global.group_concat_max_len = integer;
If you do not have the privileges to do this on the server where your database resides then use a query like:
mySQL="SET @@session.group_concat_max_len = 10000;"or a different value.
Next line:
SET objRS = objConn.Execute(mySQL)  your variables may be different.
then
mySQL="SELECT GROUP_CONCAT(......);" etc
I use the last version since I do not have the privileges to change the default value of 1024 globally (using cPanel).
Hope this helps.

Top 3 video Explaining group concat - MySQL and GROUP_CONCAT() maximum length

Related QUESTION?