Is there any way to copy database structure without data in MySQL, so the new database will be the same as it is copied from, but with empty tables.
After getting some s
You can backup you MYSQL database structure with
mysqldump -u username –p -d database_name > backup.sql
(You should not supply password at command line as it leads to security risks.MYSQL will ask for password by default.) And you can create create tables in database with
mysql -u username -p new_database < backup.sql
Now you can use pipe to give the output of first command as output for second one and you will no longer need backup.sql
mysqldump -u username –p -d database_name|mysql -u username -p new_database
All tables in will be created in new_database
without data.