修改mysql的group_concat字符长度限制

mysql的group_concat是有长度限制的,默认是1024. 超出长度会被截断

修改group_concat长度的方法:

1.查看group_concat长度:

show variables like "group_concat_max_len";

2.临时修改,在mysql客户端

SET GLOBAL group_concat_max_len=1024000;
SET SESSION group_concat_max_len=1024000;

3.修改mysql配置文件my.cnf永久修改

group_concat_max_len = 102400

修改配置文件需要重启mysql服务才能生效。

发布了49 篇原创文章 · 获赞 17 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/unhejing/article/details/103474114