
1 查找原因
至此,只能从SQL语句出发了。网上搜了下 GROUP_CONCAT 数据截断的问题,答案都指向了 group_concat_max_len 这个参数,它的默认值正好是1024。可以直接在数据库中通过下面的命令查看这个默认值:
mysql>show variables like 'group_concat_max_len'
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| group_concat_max_len | 1024 |
+----------------------+-------+
1 row in set (0.00 sec)
mysql>
MySQL官方手册 对它的定义是The maximum permitted result length in bytes for the GROUP_CONCAT() function. ,也就是它限制了GROUP_CONCAT数据的长度。
2 解决问题
只要调整 group_concat_max_len到最大值就行了
show tables 是管理语句,不能作为标准sql语句使用在子语句场合。可以直接查系统的字典表来进行:
select right(table_name, 5) from information_schema.tables where table_name like '%usermeta'
# information_schema 是系统字典所在的数据库,其中的tables表记录了数据库的所有表。
# desc information_schema.tables #有很多你想知道的信息了。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)