In this tutorial learn how to export mysql Schema with or without data.
1. with data
You can do with the --no-data option with mysqldump command
1. with data
You can do with mysqldump command
mysqldump -u root -p dbname > schema.sql
you can also extract schema with Table name with --no-data option
mysqldump -u user -h localhost -p database tablename > table.sql
2. Without DataYou can do with the --no-data option with mysqldump command
mysqldump -u root -p --no-data dbname > schema.sql
you can also extract schema with Table name with --no-data option
mysqldump -u user -h localhost --no-data -p database tablename > table.sql
This will produce a .sql file that you can load onto a mysql server to create a new fresh database.
No comments:
Post a Comment