Following command dumps MySql database's schema into a file:
mysqldump -u<username>i -p<password> -h<host> --databases <database1> --no-data > dump.sql
Above command exports single or multiple databases into dump.sql. This only exports database schema without any table contents.
This exported schema can be restored using following command:
mysql -u<username>i -p<password> -h<host> <database_name> < dump.sql
This exported schema can be restored using following command:
mysql -u<username>i -p<password> -h<host> <database_name> < dump.sql
Many thanks for your post.
ReplyDeleteAs I am newbie in Mysql, your post helped me a lot.