Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using MySQL v5.1 on Ubuntu machine.

I have a database named db_test which contain tables like cars, customers, departments, prices , and so on.

I know I can use the following commands to dump out the db_test database and dump the database back into a new database in following way:

mysqldump -u username -p -v db_test > db_test.sql
mysqladmin -u username -p create new_database
mysql -u username -p new_database < db_test.sql

But for my new_database , I only needs some tables from db_test database, not all the tables.

So, How can I dump out some tables from db_test database and dump these tables back to my new_database ?

share|improve this question
up vote 2 down vote accepted

You'll find what you need directly in the mysqldump documentation:

mysqldump -u username -p db_test table1 table2 ... > db_test.sql

Load the dump the same way as if it was a full database dump.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.