mysqldump multiple/selected tables

June 23, 2009 at 4:27 am (mysql) (, , , , )

This post explains how to dump selected tables only.
The actual syntax being:
mysqldump [ -u ] DATABASE_NAME [TABLES_LIST] > FILE_NAME

So, to dump the entire database use,
mysqldump -u USER_NAME DATABASE_NAME > FILE_NAME

To dump only selected tables use,
mysqldump -u USER_NAME DATABASE_NAME TABLE_1 TABLE_3 TABLE_4 TABLE_9 > FILE_NAME

Advertisements

1 Comment

  1. Rajiv Narayana said,

    You can import a dump into the database by reversing the sign..

    example:

    mysqldump -u USER_NAME DATABASE_NAME < FILE_NAME

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

%d bloggers like this: