tags:

views:

57

answers:

3

I want to dump mysql database only the tables which have data, Can u please give me your suggestion. this is more helpful

Thanks & Regards, Vara Kumar.PJD

+1  A: 

You can use the --ignore-table option, but you have to find out which tables are empty first as this is not directly possible with mysqldump. So you could do

mysqldump -u username -p database --ignore-table=database.table1 --ignore-table=database.table2 > database.sql
halfdan
+1  A: 
mysqldump <database options> table1 table2 table3 ...
Guillaume Lebourgeois
there are many tables, it hard to write each one. is there any option that can dump table with data as well create , add-drop statements
varakumar.pjd
A: 

Use mysqldump (documentation located here). If you do not specify tables it assumes all tables. You can also explicitly choose tables to copy or to ignore. You can tell it to create drop statements before your create statements. If you have mysql 5.1.2 then you can tell it to copy routines.

stocherilac