I would like to truncate all tables from a MySQL database. Is there a syntax in one command?
Release : 21.2
Component : Spectrum Reporting
./mysql --defaults-file=../my-spectrum.cnf -uroot -pMySqlR00t ddmdb -Nse "show tables" | while read table; do ./mysql --defaults-file=../my-spectrum.cnf -uroot -pMySqlR00t ddmdb -e "truncate table $table"; done
./mysql --defaults-file=../my-spectrum.cnf -uroot -pMySqlR00t archive -Nse "show tables" | while read table; do ./mysql --defaults-file=../my-spectrum.cnf -uroot -pMySqlR00t archive -e "truncate table $table"; done