tencent cloud

TDSQL for MySQL

Announcements
Alarm Upgrade
Product Introduction
Overview
Strengths
Use Cases
Regions and AZs
InnoDB engine
Purchase Guide
Billing Overview (InnoDB)
Product Pricing (InnoDB)
Purchase and Upgrade
Refund
Payment Overdue
Backup Space Billing
Getting Started
InnoDB Engine
Operation Guide(InnoDB)
Instance Management
Disaster Recovery Read-Only Instance
Changing Networks
Account Management
Security Management
Slow Query Analysis
Backup and Rollback
Data Migration
Database Audit
Practical Tutorial
Import from Standalone Instance to TDSQL Instance
Import Between TDSQL Instances
Selection of TDSQL Instance and Shard Configuration
Security White Paper
Platform Security Design
Tenant Security Features
Development Guide
InnoDB
API Documentation
History
Introduction
API Category
Security Group APIs
Other APIs
Making API Requests
TDSQL APIs
Data Types
Error Codes
FAQs
InnoDB
General References
Performance Comparison Data for Strong Sync
Glossary
Contact Us

Exporting/Importing Data

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-10-20 16:52:09

Exporting Data

TDSQL for MySQL supports exporting data with mysqldump. Before export, you need to set the net_write_timeout parameter (set global net_write_timeout=28800) in the TDSQL for MySQL Console. Note that command line utilities are not authorized by TDSQL for MySQL, so you can set the parameter only in the console.
mysqldump --compact --single-transaction --no-create-info -c db_name table_name -utest -h10.xx.xx.34 -P3336 -ptest123
Note:
The db and table parameters should be specified based on the actual situation. If the exported data is to be imported into another set of TDSQL for MySQL environment, the -c option must be added.
Export account needs to have select on *.* permissions.

Importing Data

TDSQL for MySQL provides a professional tool to import data specified by load data outfile. This tool shards a source file into multiple files according to the shardkey routing rules, and passes each file through to the corresponding backend database.
[tdengine@TENCENT64 ~/]$./load_data

format:./load_data mode0/mode1 proxy_host proxy_port user password db_table shardkey_index file field_terminate field_enclosed

example:./load_data mode1 10.xx.xx.10 3336 test test123 shard.table 1 '/tmp/datafile' ' ' ''
Note:
The source file must use '\\n' as a line break.
mode0 means that the source file is sharded but will not be imported, which is usually used for debugging. To import data, use mode1.
shardkey_index starts from 0. If the shardkey is the second field, shardkey_index should be 1.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan