All Products
Search
Document Center

:The error message "The connection has been closed" is displayed when you export data to an apsaradb RDS for MySQL instance by using DMS

Last Updated:May 20, 2022

Problem description

When you use DMS to export data to an apsaradb RDS for MySQL instance, the following error message is displayed.

The MySQL server has been disconnected due to the long execution time. In this case, adjust the wait_timeout parameter value of the MySQL server.

Cause

The value of the wait_timeout parameter is not the default value, causing the connection to time out.

Solution

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.

First, check whether the load of the RDS MySQL instance is normal. Then, check whether the values of the wait_timeout and interactive_timeout parameters are the same as the default values.

  • If the load is normal and the wait_timeout and interactive_timeout parameters are set to their default values, you can view the parameter settings of the console to increase the values of the wait_timeout and interactive_timeout parameters. If the CPU load reaches 100%, solve the CPU problem first.
    Description
    • The wait_timeout parameter controls the timeout period for non-interactive mode connections (in seconds, the default value is 24 hours, or 86400 seconds).
    • The interactive_timeout parameter controls the timeout period for connection connections in interactive mode. Unit: Seconds. The default value is 2 hours, which means 7200 seconds.

  • If you increase the values of the wait_timeout and interactive_timeout parameters and the CPU utilization is normal and the connection still times out, we recommend that you run the mysqldump command to export data.

Scope

  • ApsaraDB RDS for MySQL
  • Data Management