- Instant help with your Sql coding problems

Backup MySQL schema only

Question:
How to backup MySQL schema only?
Answer:
mysqldump -u testuser -p --no-data testdb > /tmp/testdb_schema.sql

mysqldump -u [MYSQL_USER] -p --no-data [DB_NAME] > [OUTPUT_FILE]
Description:

Using the --no-data option with mysqldump it does not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the CREATE TABLE statement for the table (for example, to create an empty copy of the table by loading the dump file).

Share "How to backup MySQL schema only?"