Skip to content

Instantly share code, notes, and snippets.

@gophry
Forked from Suave/gist:6127873
Created January 12, 2016 11:50
Show Gist options
  • Save gophry/045102797ccbc04c4f5d to your computer and use it in GitHub Desktop.
Save gophry/045102797ccbc04c4f5d to your computer and use it in GitHub Desktop.
mysql: truncate all tables in one command line
mysql -Nse 'show tables' DATABASE_NAME | while read table; do mysql -e "truncate table $table" DATABASE_NAME; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment