Home >Database >Mysql Tutorial >mysqlpump - MySQL database backup program

mysqlpump - MySQL database backup program

王林
王林forward
2023-09-20 11:29:021250browse

mysqlpump - MySQL 数据库备份程序

#The mysqlpump client utility performs a logical backup, thereby generating a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It helps in dumping one or more MySQL databases for backup or transfer to another SQL server.

Function of mysqlpump

Let us understand the function of mysqlpump-

  • Parallel processing of the database and the objects in the database, thus helping to speed up the dump process.

  • It provides better control over which databases and database objects (tables, stored procedures, user accounts) need to be dumped

  • Will user accounts be dumped Dumped into account management statements (CREATE USER, GRANT) Instead of inserting into the mysql system database as

  • it has the ability to create compressed output.

  • This is an indicator that provides an estimate of progress.

  • For dump file reloading, it can speed up the creation of secondary indexes for InnoDB tables by adding indexes after rows are inserted.

    >

Syntax - Calling mysqldump

By default, mysqlpump dumps all databases. To specify this behavior explicitly, use the --all-databases option. As shown below -

shell> mysqlpump --all-databases

To dump a single database or a specific table in a database, the database name must be specified on the command line, followed by the table name. As shown below -

shell> mysqlpump db_name
shell> mysqlpump db_name tbl_name1 tbl_name2 ...

To treat all name parameters as database names, you can use the --databases option. As shown below -

shell> mysqlpump --databases db_name1 db_name2 ...

mysqlpump utility supports multiple options to include or exclude databases, tables, stored procedures and user definitions. To reload the dump file, the statements contained within need to be executed. The example below shows the same -

shell> mysqlpump [options] > dump.sql
shell> mysql < dump.sql

The above is the detailed content of mysqlpump - MySQL database backup program. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete