Wednesday, 25 August 2010

如何备份MySQL数据库?

Download a database from the source server, use following command:
mysqldump -u user_name -p database_name > backup_file_name

Create the database in the destination server if it does not exist:
create database database_name

Upload the database onto the destination server, user following command:
mysql -u user_name -D database_name -p < backup_file_name

No comments:

Post a Comment

Note: only a member of this blog may post a comment.