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
To dump entire databases, do not name any tables following db_name , or use the --databases or --all-databases option. To see a list of the options your version of mysqldump supports, issue the command mysqldump --help.
4 mysqldump — A Database Backup Program. The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL databases for backup or transfer to another SQL server.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With