Fail to migrate data to a new read replica

Problem

When creating a read replica in Cloud SQL for MySQL of an external primary, for example, on premises, Amazon Web Services, etc. Or when attempting to initialize the migration of data to a new read replica, you may see the following errors in your Cloud SQL logs:

error during mysqldump: import err = generic::unknown: signal: killed , mysqldump err = exit status 5, stderr = mysqldump: [Warning] Using a password on the command line interface can be insecure. mysqldump: Got errno 32 on write

Environment

  • Cloud SQL for MySQL
  • Read replica with external primary

Solution

  1. Increase the value of the flag max_allowed_packet on both the external primary and on the replica to the maximum value of 1 GB, then retry the migration.
  2. Perform a manual dump of the data to a Cloud Storage bucket using mysqldump, and create a new replica from this file. The replica will begin to sync from the primary after it is created if you choose that option.

Cause

Got errno 32 on write refers to a broken pipe error. This error can occur when packets are received from the dump which are too large for the default setting of the flag max_allowed_packet.

The warning in this error message, Using a password on the command line interface can be insecure, can be ignored in this case. It is only a warning and will not cause the data transfer to fail.