Can I get a dump of all my databases *except one* using mysqldump? Can I get a dump of all my databases *except one* using mysqldump? windows windows

Can I get a dump of all my databases *except one* using mysqldump?


mysql ... -N -e "show databases like '%';" |grep-v -F databaseidontwant |xargsmysqldump ... --databases > out.sql


echo 'show databases;' | mysql -uroot -proot | grep -v ^Database$ | grep -v ^information_schema$ | grep -v ^mysql$ | grep -v -F db1 | xargs mysqldump -uroot -proot  --databases > all.sql

dumps all databases except: mysql, information_schema, mysql and db1.

Or if you'd like to review the list before dumping:

  1. echo 'show databases;' | mysql -uroot -proot > databases.txt
  2. edit databases.txt and remove any you don't want to dump
  3. cat databases.txt | xargs mysqldump -uroot -proot --databases > all.sql


What about

--ignore-table=db_name.tbl_name

Do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, use this option multiple times.

Maybe you'll need to specify a few to completely ignore the big database.