The mysqldump program writes the contents of database tables into text files. These files may be used for a variety of purposes, such as database backups, moving databases to another server, or setting up a test database based on the contents of an existing database.

By default, output for each dumped table consists of a CREATE TABLE statement that re-creates the table, followed by a set of INSERT statements that reload the contents of the table. If the --tab option is given, table contents are written to a data file in raw format, and the table creation SQL statement is written to a separate file.


mysqldump [options] db_name [tbl_name] …

If no tables are named following the database name db_name, all tables in the database ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.