limited time offer

What is the function of mysqldump?

mysqldump is a useful utility tool of MySQL that is used to dump one or more or all databases from the server for backup or transfer to another database server.

For a single database:

mysqldump [OPTIONS] db_name [TABLES]

For multiple databases:

mysqldump [OPTIONS] –databases DB1 [DB2 DB3...]

For all databases:

mysqldump [OPTIONS] –all-databases

Example: The following command will create a dump of the "newdb" database and export the content of the database in the file, newdb.sql.

mysqldump –databases newdb > newdb.sql