Consider using the MySQL Shell dump utilities, which provide parallel dumping with multiple threads, file compression, and progress information display, as well as cloud features such as Oracle Cloud Infrastructure Object Storage streaming, and MySQL Database Service compatibility checks and modifications. 考虑使用MySQL Shell转储实用程序,该实用程序提供多线程并行转储、文件压缩和进度信息显示,以及Oracle云基础设施对象存储流和MySQL数据库服务兼容性检查和修改等云功能。Dumps can be easily imported into a MySQL Server instance or a MySQL Database Service DB System using the MySQL Shell load dump utilities. 转储可以使用MySQL Shell加载转储实用程序轻松导入MySQL Server实例或MySQL数据库服务DB系统。Installation instructions for MySQL Shell can be found here.MySQL Shell的安装说明可以在这里找到。
This section describes how to use mysqldump to produce dump files, and how to reload dump files. A dump file can be used in several ways:本节介绍如何使用mysqldump生成转储文件,以及如何重新加载转储文件。转储文件可以通过多种方式使用:
As a backup to enable data recovery in case of data loss.作为备份,以便在数据丢失时进行数据恢复。
As a source of data for setting up replicas.作为设置副本的数据源。
As a source of data for experimentation:作为实验数据来源:
To make a copy of a database that you can use without changing the original data.制作一个数据库的副本,您可以在不更改原始数据的情况下使用它。
To test potential upgrade incompatibilities.测试潜在的升级不兼容性。
mysqldump produces two types of output, depending on whether the mysqldump根据是否给出--tab
option is given:--tab
选项产生两种类型的输出:
Without 如果没有--tab
, mysqldump writes SQL statements to the standard output. --tab
,mysqldump会将SQL语句写入标准输出。This output consists of 此输出由创建转储对象(数据库、表、存储例程等)的CREATE
statements to create dumped objects (databases, tables, stored routines, and so forth), and INSERT
statements to load data into tables. CREATE
语句和将数据加载到表中的INSERT
语句组成。The output can be saved in a file and reloaded later using mysql to recreate the dumped objects. 输出可以保存在文件中,稍后使用mysql重新加载以重建转储的对象。Options are available to modify the format of the SQL statements, and to control which objects are dumped.可以使用选项修改SQL语句的格式,并控制转储哪些对象。
With 使用--tab
, mysqldump produces two output files for each dumped table. --tab
,mysqldump为每个转储的表生成两个输出文件。The server writes one file as tab-delimited text, one line per table row. 服务器以制表符分隔的文本形式写入一个文件,每个表行一行。This file is named 此文件在输出目录中名为
in the output directory. tbl_name
.txttbl_name.txt
。The server also sends a 服务器还将表的CREATE TABLE
statement for the table to mysqldump, which writes it as a file named
in the output directory.tbl_name
.sqlCREATE TABLE
语句发送到mysqldump,mysqldump将其作为名为tbl_name.sql
的文件写入输出目录。