Help Center> Distributed Database Middleware> User Guide> Data Management> Data Migration> Scenario 6: Exporting Data from a DDM Instance

Scenario 6: Exporting Data from a DDM Instance

Scenarios

Export data from a DDM instance to a SQL text file.

Export Table Structure

Run the following command to export table structure:

mysqldump -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p --no-data --single-transaction --skip-add-locks --add-locks=false {DB_NAME} {TABLE_NAME} > {mysql_table_schema_ddm.sql}

Export Table Data

Run the following command to export table data:

mysqldump -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p --single-transaction --hex-blob --complete-insert --set-gtid-purged=OFF --quick --no-create-info --skip-comments [--where=""] --skip-add-locks --add-locks=false {DB_NAME} {TABLE_NAME} > {mysql_table_data_ddm.sql}
  • Export table data during off-peak hours. This is because performance of the DDM instance and associated RDS DB instances may be affected during data export.
  • You can connect to the target RDS MySQL DB instance to export data of unsharded tables to improve export efficiency.
  • MySQL 5.7 official website: https://dev.mysql.com/downloads/mysql/5.7.html.