DUMP_TABLES(1) User Contributed Perl Documentation DUMP_TABLES(1) NAME dump_tables.pl - a perl program to dump specific list of databases/tables SYNOPSIS dump_tables.pl --options --arguments DESCRIPTION This script allows you to dump databases from one host and directly upload the data back to mysql on another host. You can omit specified tables or databases to work on. If you do not specify any --db option, a list of databases will be fetched from source database host (--from-host). If you do not specify any --table , list of tables will be fetched for each database from mysql host. The strong advantage of this program is to selectively include or exclude some databases or tables which you do or do not want to modify. Hence we offer --omit-(table|database) and --table and --db arguments. The program is clever enough to figure out what tables or databases are present on the system and operate on all of them, if no --db or --table was specified. Note that this program will take the advantage of ~/.my.cnf file, so you do not have to specify username, password, hostname, port on a commandline. OPTIONS of dump_tables.pl --db database name, this option can be specified multiple times on a command-line --table table name, this option can be specified multiple times on a command-line --omit-table do not copy this table --omit-database do not copy this database --from-host name of sql server, *from* which we dump data --to-host name of sql server, *to* which we import data --user sql username for both sql servers --password sql password for both sql servers --port sql port for both sql server --stdin read list of databases from STDIN --all-on-from-host copy all databases available on source sql host --missing-on-to-host copy databases missing on target sql host (does NOT check for table missing in databases present on both servers). --all-on-to-host copy those databases from source host, which are already present on target sql server --dry-run do not copy anything, just print messages instead. Use for testing. OPTIONS PASSED TO mysqldump --add-locks --delayed-insert --add-drop-table --force EXAMPLES dump_tables.pl --db=db1 --db=db2 --from-host=foo --to-host=bar --dry-run dump_tables.pl --db=db1 --db=db2 --from-host=foo --to-host=bar --omit- table=table3 cat list.txt | dump_tables.pl --db=db1 --db=db2 --from-host=foo --to- host=bar --omit-table=table3 --stdin dump_tables.pl --db=db1 --db=db2 --from-host=foo --to-host=bar --add-drop- table --add-locks dump_tables.pl --missing-on-to-host --from-host=foo --to-host=bar --omit- database=db3 --missing-on-to-host will figure out which *databases* are missing on target host dump_tables.pl --all-on-from-host --from-host=foo --to-host=bar --omit- database=db3 AUTHOR Martin Mokrejs http://www.natur.cuni.cz/~mmokrejs/mysql-tools