Scenario 6: Exporting Data from a DDM Instance
- Export table data during off-peak hours. This is because performance of the DDM instance and its associated RDS instances may be affected during the export.
- Use mysqldump to dump database data on a large disk to ensure that there is enough disk space.
- Run nohup {mysqldump CLI} & in Linux to ensure that mysqldump still works when a session times out.
Scenarios
Export data from a DDM instance to a SQL text file.
Export Table Structure
If the DDM version is 2.4.X or later, run the following command to export table structure:
- If the MySQL client version is 5.6 or 5.7, run the following command:
mysqldump -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p --no-data --skip-lock-tables --default-auth=mysql_native_password --skip-tz-utc {DB_NAME} {TABLE_NAME} > {mysql_table_schema_ddm.sql}
- If the MySQL client version is 8.0, run the following command:
mysqldump -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p --no-data --skip-lock-tables --default-auth=mysql_native_password --column-statistics=0 --skip-tz-utc {DB_NAME} {TABLE_NAME} > {mysql_table_schema_ddm.sql}
Export Table Data
If the DDM version is 2.4.X or later, run the following command to export table data:
mysqldump -h {DDM_ADDRESS} -P {DDM_PORT} -u {DDM_USER} -p --skip-lock-tables --add-locks=false --hex-blob --complete-insert --set-gtid-purged=OFF --quick --no-create-info --skip-comments [--where=""] --skip-tz-utc{DB_NAME} {TABLE_NAME} > {mysql_table_data_ddm.sql}
- You can connect to the target RDS for MySQL instance to export data of unsharded tables to improve export efficiency.
- For details about mysqldump5.7, visit https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.