anjakammer
8/1/2013 - 2:05 AM

mysql: truncate all tables in one command line

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