Check out my latest project: Code Dumper

MySQL dump tables like...

mysql $DB -u$USERNAME -p$PASSWORD -e 'show tables like "$LIKE%"' | grep -v Tables_in | xargs mysqldump --add-drop-table $DB -u$USERNAME -p$PASSWORD

Replace dollar variables with your details to drop a group of tables. Useful when you've got one database hosting a number of different web sites and you need a dump of a particular site.

2 Responses to “MySQL dump tables like...”

  1. This is my first code dump entry - I'll be trying to post these whenever I think the code is useful enough to share.

    Note that the $dollar variables should be replaced as appropriate for your table dump.

  2. Thanks!
    Very useful!

Leave a Reply
Not required

CODE: Please escape code and wrap in <pre><code>, doing so will automatically syntax highlight