mysql的group_concat()函数的默认返回1024个字节长度,超过长度会被截取掉。
可以通过以下sql查询:
show variables like 'group_concat_max_len';
解决方法:
在mysql的配置文件,my.ini中mysqld下增加group_concat_max_len = 10240000
mysql中执行:set global group_concat_max_len=10240000;
或者set session group_concat_max_len=10240000;
global对全局有效,session只对当前会话有效。需要管理员才能操作global!
重启mysql服务器生效
linux下的mysql一样的设置,只不过linux下的mysql配置文件是/etc/my.cnf设置!