Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathieuthollet/35740f37a9e855aca17337e4adb1f77e to your computer and use it in GitHub Desktop.
Save mathieuthollet/35740f37a9e855aca17337e4adb1f77e to your computer and use it in GitHub Desktop.
How to do a mysql dump of table filtered by prefix
mysql -u {username} -p{password} -N -e 'show tables like "{prefix}\_%"' {dbname} | xargs mysqldump -u {username} --password={password} --single-transaction {dbname} > {filename}.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment