Spockwang's Blog

MySql Help

| 评论

Backup and Recovery

Use following command to backup an InnoDB table

1
2
$ mysqldump -u username -p password --default-character-set=utf8 
    --single-transaction db_name table_name > db_name-table_name-backup.sql

If you want to backup the whole database you just omit the table name. And then use the following command to recover the table.

1
$ mysql -u username -p password db_name-table_name-backup.sql

Comments