Skip to content

Instantly share code, notes, and snippets.

@madeingnecca
Created September 26, 2012 19:31
Show Gist options
  • Save madeingnecca/3790046 to your computer and use it in GitHub Desktop.
Save madeingnecca/3790046 to your computer and use it in GitHub Desktop.
MYSQL utils
# Execute query from string.
mysql -D <DATABASE> -h <HOST> -u <USER> -p -e 'DELETE FROM table';
# Dump only tables with specific prefix. *NEEDS REVISION*
mysqldump -u <USER> -p <DATABASE> $(mysql -u <USER> -p -D <DATABASE> -Bse "SHOW TABLES LIKE 'PREFIX_%'");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment