priya
priya

Reputation: 26759

How do I selectively import few tables from a mysqldump

I have 5 tables in my dev database and I have take a mysqldump of all the tables. I would like to re-create a different database only with 4 tables from the above mysqldump, how do I do that.

Note: I would like to skip data population for the 5th table, but would like to retain the schema definition for the table though.

Upvotes: 1

Views: 459

Answers (1)

Devart
Devart

Reputation: 122032

You should do it in two steps:

  1. Use --no-data option: >mysqldump -no-data database_name
  2. Use --no-create-info and --tables options: >mysqldump --no-create-info database_name --tables table1 table2 table3 table4

mysqldump — A Database Backup Program

Upvotes: 2

Related Questions