Mysql: Truncate all tables for database
mysql -uroot --password="mypassword" -Nse 'show tables' databasename | while read table; do mysql -uroot --password="mypassword" -e "SET FOREIGN_KEY_CHECKS=0;truncate table $table;SET FOREIGN_KEY_CHECKS=1;" databasename; done
0 comentarios