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).
Reference:
mysqldump no-data reference
Share "How to backup MySQL schema only?"
Related snippets:
Tags:
backup mysql schema, db schema only, export mysql schema Technical term:
Backup MySQL schema only