MySQL GROUP_CONCAT limitation solution

MySQL GROUP_CONCAT limitation solution

effect:

The GROUP_CONCAT function can concatenate a field value into a string. The default separator is a comma, i.e., ",

If you need a custom separator, you can use SEPARATOR

like:

SELECT GROUP_CONCAT(name SEPARATOR '_') FROM user

limit:

The default length of the string concatenated by GROUP_CONCAT is 1024 bytes. If it exceeds this length, it will be truncated.

Query the default length:

Order

SHOW VARIABLES LIKE 'group_concat_max_len'

Operation method: (as shown in the picture)

Adjust the length setting method:

(1) Add the following to the MySQL configuration file:

File: my.ini

Additional settings:

group_concat_max_len = 102400

(2) SQL statement:

SET GLOBAL group_concat_max_len = 102400;SET SESSION group_concat_max_len = 102400;

Note: The disadvantage of this method is that the settings will become invalid after restarting the service

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to modify the length limit of group_concat in Mysql
  • Perfect solution to the problem of data being truncated when using the group concat function in Mysql5.7
  • A brief discussion on the sorting method of the group_concat() function in MySQL
  • Summary of mysql group_concat() function usage
  • Analysis of traps in using the MySQL statistical function GROUP_CONCAT
  • MySql uses GROUP_CONCAT to merge multiple data displays
  • mysql uses group_concat() to merge multiple rows of data into one row
  • MySQL group_concat function usage examples
  • In-depth understanding of group_concat function in MySQL
  • How to use the Mysql GROUP_CONCAT() function

<<:  Vue keeps the user logged in (various token storage methods)

>>:  How to change password and set password complexity policy in Ubuntu

Recommend

CentOS8 - bash: garbled characters and solutions

This situation usually occurs because the Chinese...

Forty-nine JavaScript tips and tricks

Table of contents 1. Operation of js integer 2. R...

Several principles for website product design reference

The following analysis is about product design pr...

Example code for implementing random roll caller in html

After this roll call device starts calling the ro...

Solution to win10 without Hyper-V

Are you still looking for a way to enable Hyper-v...

Using an image as a label, the for attribute does not work in IE

For example: Copy code The code is as follows: <...

Detailed explanation of meta tags and usage in html

I won’t waste any more time talking nonsense, let...

vue dynamic component

Table of contents 1. Component 2. keep-alive 2.1 ...

Docker network principles and detailed analysis of custom networks

Docker virtualizes a bridge on the host machine. ...

Manual and scheduled backup steps for MySQL database

Table of contents Manual backup Timer backup Manu...

The order of event execution in the node event loop

Table of contents Event Loop Browser environment ...

Graphic tutorial on installing Ubuntu 18.04 on VMware 15 virtual machine

In the past few years, I have been moving back an...

The most basic code for web pages

◆Add to favorites illustrate Click to add your we...

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...