Custom Search

Tuesday, May 10, 2011

How to mysqldump without CREATE TABLE statements

MySql Dump
# mysqldump -u dbuser -p[pwd] --opt databasename > database_backup.sql
MySql Dump without data (only structure)
# mysqldump -u dbuser -p[pwd] --no-data databasename > database_backup.sql
or
# mysqldump -u dbuser -p[pwd] -d databasename --no-data > database_backup.sql
MySql Dump without structure (no drop/create table)
# mysqldump -u dbuser -p[pwd] --no-create-db --no-create-info databasename >
database_backup.sql
Import SQL file
mysql -u user_name -p  database_name < /path/to/file.sql

No comments:

Post a Comment