Skip to content

Instantly share code, notes, and snippets.

@azimsai
Forked from Suave/gist:6127873
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save azimsai/e4978ff4cea4c4196226 to your computer and use it in GitHub Desktop.

Select an option

Save azimsai/e4978ff4cea4c4196226 to your computer and use it in GitHub Desktop.
Truncate all tables in database
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