Help Center> Cloud Data Migration> FAQs> Troubleshooting> What Should I Do If Error Message "Lost connection to MySQL server during query" Is Displayed During Migration from MySQL to DWS?
Updated on 2023-06-21 GMT+08:00

What Should I Do If Error Message "Lost connection to MySQL server during query" Is Displayed During Migration from MySQL to DWS?

Symptom

Error message "GENERIC_JDBC_CONNECTOR_0904:ERROR occurs while retrieving data from result. Cause : closed connection:stream closed con:192.168.XX.XX." is displayed during data migration from MySQL to DWS.

Fault Analysis

  1. The error may occur due to a large amount of user data or a connection interruption. Check whether the timeout duration is configured in the advanced attributes.

  1. The timeout duration is 6,000,000 milliseconds, which is large enough. Check whether the MySQL database of the customer is normal. Run the SQL statement for querying the source in the log and run the SQL statement on the MySQL client to check whether an error is reported.

  1. When the query statement is executed to query the entire table, error message "Lost connection to MySQL server during query" is displayed. When the count statement is executed again to query data, the query is successful.
  2. The value of max_allowed_packet for the MySQL database is too small. However, the value is 1 GB and cannot be increased.
  3. Check the connector configuration. It is found that Fetch Size is set to 3000. As a result, the volume of data to be queried in a batch may exceed 1 GB, and an error is reported.

Solution

  1. Set Fetch Size to 1000.
  2. Use the where clause to periodically migrate some data.

Troubleshooting FAQs

more