Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysqldump more than one table?

How can I use mysqldump to dump certain tables that start with common prefix?

like image 837
mabuzer Avatar asked Jun 01 '10 11:06

mabuzer


People also ask

How do I dump multiple tables in MySQL?

To dump multiple tables with multiple where conditions. Then, for second table, use ">>". It will append the previous dump file.

Can Mysqldump lock tables?

By default, the mysqldump utility, which allows to back a MySQL database, will perform a lock on all tables until the backup is complete.

Which flag allows you to dump all the database table entries?

To dump large tables, you could combine the following two flags, --single-transaction and --quick .


1 Answers

Hehe, this is kind of a hack, but it works (using bash):

mysqldump -u USER -p DATABASE $(mysql -u USER -p -D DATABASE -Bse "show tables like 'PREFIX%'") > /tmp/DATABASE.out

Change the ALLCAPS words as needed.

like image 73
unutbu Avatar answered Oct 21 '22 21:10

unutbu