copy database structure without data in mysql (with empty tables)
You can take backup using mysqldump and restore with mysql using commandline.
For backup database
$ mysqldump -u root-pPassword -P3309 --routines --no-data testdb > "d:\dbwithnodata.sql"
For restoration of database
$ mysql -u root-pPassword -P3309 newdb < "d:\dbwithnodata.sql"
mysqldump -u user -ppass -d olddb | mysql -u user -ppass -D newdb
The new database must already exist. The -d
flag in the mysqldump command prevents copying of data.
There's no space between the flag -p
and the password.