mysqldump — A Database Backup Program for MySQL


 

There are three general ways to invoke mysqldump:

shell> mysqldump [options] db_name [tables]

shell> mysqldump [options] --databases db_name1 [db_name2 db_name3...]

shell> mysqldump [options] --all-databases

In its simplest form, the mysqldump utility can be used like this:

mysqldump –-user [user name] –-password=[password] [database name] > [dump file]

this will include both the schema and data as well.

If you need only the schema use the -d or --no-data option

e.g. mysqldump -d -u root -pp@ssword mydatabase > mydatabase.sql

Reference: MySQL :: MySQL 5.0 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s