MYSQL CONCAT MAX LENGTH

ⅰ亾dé卋堺 提交于 2019-11-28 11:07:16

Presumably you're using GROUP_CONCAT(), not simple CONCAT().

The default value of the group_concat_max_len is 1024, which is a pretty small limit if you're building up big long concatenations.

To change it, use this command. I've set the length in this example to 100,000. You could set it to anything you need.

 SET SESSION group_concat_max_len = 100000;

The usual value for max_allowed_packet is one megabyte, which is likely more than you need.

group_concat_max_len itself has an effectively unlimited size. It's limited only by the unsigned word length of the platform: 2^32-1 on a 32-bit platform and 2^64-1 on a 64-bit platform.

If that still isn't enough for your application, it's time to take @eggyal's suggestion and rethink your approach.

You need change group_concat_max_len default value in the bellow config file   
**my.cnf file(Linux) and my.ini file(windows)**   

[mysqld]//Add this line group_concat_max_len=15000 under mysqld section

group_concat_max_len=15000

Note: After change is done You need to restart your MySQL server.   
my.cnf file path in linux :   
 1. /etc/my.cnf   
2./etc/mysql/my.cnf   
3.$MYSQL_HOME/my.cnf   
4.[datadir]/my.cnf   
5.~/.my.cnf  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!