How to keep backup of our database in MySql
I want to keep backup of my database and import it into different System? and how to开发者_开发问答 make .dmp or store file in MySql?
You can dump a database with the mysqldump
command-line utility ; using a command like this :
mysqldump --user=USERNAME --password=PASSWORD --host=ORIGIN_HOST DATABASE_NAME > backup.sql
Then, as the backup is just a bunch of SQL instruction, importing it to another database is as easy as using the mysql
command-line utility :
mysql --user=USERNAME --password=PASSWORD --host=DESTINATION_HOST NEW_DATABASE_NAME < backup.sql
And, as a couple of references to the relevant manual pages :
- 4.5.4. mysqldump — A Database Backup Program
- 4.5.1. mysql — The MySQL Command-Line Tool
- and Chapter 6. Backup and Recovery
Read the manual. If there's something there that you're not sure about, ask a more specific question.
精彩评论