Skip to content

Instantly share code, notes, and snippets.

@Mrkisha
Forked from Suave/gist:6127873
Created June 16, 2016 11:38
Show Gist options
  • Select an option

  • Save Mrkisha/0fd2d252ba67061a949fbf0ce53b0d5c to your computer and use it in GitHub Desktop.

Select an option

Save Mrkisha/0fd2d252ba67061a949fbf0ce53b0d5c 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