If you want to copy the structure of the table, etc. from one database to another, you can use this single bash line:
mysqldump -u user -ppass -d olddb | mysql -u user -ppass -Dnewdb
A new database must exist already. The -d flag in mysqldump prevents data from being copied.
source
share