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

JavaScript to achieve a simple magnifying glass effect

There is a picture in a big box. When you put the...

Working principle and example analysis of Linux NFS mechanism

What is NFS? network file system A method or mech...

Summary of uncommon operators and operators in js

Summary of common operators and operators in java...

Detailed explanation of several ways to create a top-left triangle in CSS

Today we will introduce several ways to use CSS t...

nginx proxy_cache batch cache clearing script introduction

Preface: I used the official nginx proxy_cache as...

Circular progress bar implemented with CSS

Achieve results Implementation Code html <div ...

MySQL database operations and data types

Table of contents 1. Database Operation 1.1 Displ...

Solution to MySQL Chinese garbled characters problem

1. The Chinese garbled characters appear in MySQL...

js realizes the dynamic loading of data by waterfall flow bottoming out

This article shares with you the specific code of...

Who is a User Experience Designer?

Scary, isn't it! Translation in the picture: ...

Vue implements form validation function

This article mainly describes how to implement fo...

Solution to the problem of repeated pop-up of Element's Message pop-up window

Table of contents 1. Use 2. Solve the problem of ...

Detailed explanation of explain type in MySQL

Introduction: In many cases, many people think th...

How to adapt CSS to iPhone full screen

1. Media query method /*iPhone X adaptation*/ @me...