Skip to content

Instantly share code, notes, and snippets.

@Suave
Created August 1, 2013 02:05
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Suave/6127873 to your computer and use it in GitHub Desktop.
Save Suave/6127873 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
@lineboy1011
Copy link

'while' is not recognized as an internal or external command,
operable program or batch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment