mysql group_concat taken default 1024 bytes

Referred to a production environment and the development environment bug generated,
since the development environment encountered when using group_concat function results taken field is shortened.
After the time of production has emerged since forgotten this setting, resulting in no first time to resolve, it is hereby record:

1, taken using the default function group_concat 1024 bytes;
may be used to view the command:

	mysql> show variables like "%concat%";

Here Insert Picture Description

  1. There are two ways to set the value of group_concat_max_len

(1) In /etc/my.cnf the [mysqld] add group_concat_max_len = 102400, mysql need to restart to take effect

(2) at a command line:

  SET GLOBAL group_concat_max_len=102400;

SESSION group_concat_max_len = 102400 or the SET;
the GLOBAL is a global force, and is valid for the current session SESSION. You need to have administrator privileges to operate GLOBAL Oh! ! !

tips: Also, if the set value is large, such as SET GLOBAL group_concat_max_len = 10240000, will lose effect, pro-test! ! !

An increase, because the system does not restart, resulting in invalid query parameters, need to restart the terminal has been connected to work

Published 14 original articles · won praise 2 · Views 175

Guess you like

Origin blog.csdn.net/weixin_41402056/article/details/104667851