Friday, May 1, 2009

Backup/RestoreMySQL thru command

Below are mysqldump commands for backup and restore mysql database:

WINDOWS:
Backup:
C:\mysql\bin> mysqldump --opt --user=username --password database > dumbfile.sql

Restore:
C:\mysql\bin>mysql --user=username --password database < dumpfile.sql


UNIX / LINUX (never try this before...)
Backup:
mysqldump --opt --user=username --password database > dumbfile.sql

Restore:
mysqldump --opt --user=username --password database < dumbfile.sql

Notes:
- dumbfile.sql contains SQL command for creating tables and data. (CREATE,INSERT,DROP etc.)

No comments:

Post a Comment