All Products
Search
Document Center

:Log on to an apsaradb for Redis instance through DMS and the system displays the "Packet for query is too large" error

Last Updated:Jun 03, 2026

When you connect to an ApsaraDB for Redis instance through Data Management (DMS), the "Packet for query is too large" error appears because the database response exceeds the MySQL max_allowed_packet limit. Increase the limit to resolve the error.

Problem description

When you log on to a database through Data Management (DMS), the following error appears:

Packet for query is too large (xxx > xxx). You can change this value on the server by setting the max_allowed_packet variable.

Cause

The data packet returned by the database query exceeds the max_allowed_packet limit in MySQL.

Note

Note:

  • The default value is 1 MB in MySQL versions earlier than 5.6, and 4 MB in MySQL 5.6 and later.

  • Do not use the default value.

Solution

Note

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.

  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.

  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

Run the following SQL statement to increase the value of the max_allowed_packet parameter to 128 MB (134217728 bytes), which is the recommended limit for DMS.

set global max_allowed_packet=134217728;
Note

Note: Set the max_allowed_packet parameter to 128 MB when using DMS.

Application scope

  • Data Management

  • Tair (Redis OSS-Compatible)