# group_concat_max_len

> Longest result the GROUP_CONCAT function may return.

Source: https://sqlly.app/sql-configuration/mysql/group-concat-max-len
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).

**Default**

`1024`

**Range**

4 to 18446744073709551615 bytes (4294967295 on 32-bit platforms)

**Restart needed**

No

**Default checked on**

MySQL 8.4 LTS

## What it does

Anything longer is cut to the limit and the query returns the truncated string with a warning, not an error. The limit is counted in bytes, and the result is additionally capped by max_allowed_packet, so a very large value here cannot actually ship more than one packet.

## Default value

`1024`. 1024 bytes (MySQL 8.4), counted in bytes rather than characters.

## Check the current value

```
SHOW GLOBAL VARIABLES LIKE 'group_concat_max_len';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'group_concat_max_len';
```

## Change it

```
SET SESSION group_concat_max_len = 1048576;   -- this connection
SET GLOBAL group_concat_max_len = 1048576;    -- new connections, until restart
SET PERSIST group_concat_max_len = 1048576;   -- new connections, and after restarts
```

No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

## When to change it

When GROUP_CONCAT output is visibly cut off, typically in report or export queries; set it in the session that runs them instead of globally.

## What can go wrong

Truncation is silent apart from a warning, so reports can ship incomplete lists without anyone noticing. Large values let one query return megabytes, which flows through max_allowed_packet to client memory, so size it to what the caller really consumes.

## Questions about group_concat_max_len

### What is the default value of group_concat_max_len in MySQL?

1024. 1024 bytes (MySQL 8.4), counted in bytes rather than characters.

### Does changing group_concat_max_len require a restart?

No. No restart. SET GLOBAL (or SET PERSIST, which also survives restarts) applies to connections opened afterwards; existing connections keep their session value unless they SET it themselves.

### When should I change group_concat_max_len?

When GROUP_CONCAT output is visibly cut off, typically in report or export queries; set it in the session that runs them instead of globally.

Back to all [MySQL settings](https://sqlly.app/sql-configuration/mysql), or check the [MySQL manual](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html) for every option.

## Related MySQL settings

- [`max_allowed_packet` Largest single packet, and so the largest row, BLOB or statement, the server accepts.](https://sqlly.app/sql-configuration/mysql/max-allowed-packet)
- [`sql_mode` SQL syntax and validation rules, as a comma-separated list of modes.](https://sqlly.app/sql-configuration/mysql/sql-mode)
