TODO:MONGODB MySQL Database backup

Source: Internet
Author: User
Tags mongodump mongorestore

TODO:MONGODB MySQL Database backup


1. MongoDB Using command Backup

Mongodump for the entire database backup, the main use of the command parameters:

-D database to back up

-O Output path

./mongodump–d Databasename–o/data/dbbak

After the backup succeeds, the folder with the database name is created in/data/dbbak, and the files are backed up under the folder.

2. MongoDB uses command restore

Mongorestore database Restore, the main use of the command parameters:

-D database to restore

-directoryperdb the directory where the backup database is located, to the database name folder

-drop Delete the data first, then restore the backup data, you need to use caution

./mongorestore–d Databasename–directoryperdb/data/dbbak/databasename

3. MongoDB backs up the entire dbpath, this is the simplest method. But compared to the cost of hard disk resources, lazy time is to directly backup DBPath

4. mysql using command backup

Mysqldump for the entire database backup, the main use of the command parameters:

-U Database Login user Name

-P Database Login password

Mysqldump-uroot-p MyData > Mydata_201611042316.sql

Used time as a backup file name, convenient to record time; ">" is the meaning of the output backup file.

5. mysql using command restore

MySQL database restore, the main use of the command has

-U Database Login user Name

-P Database Login password

Mysql-uroot-p MyData < Mydata_201611042316.sql

"<" means to import backup data

6. mysql use phpmyadmin export, format Select SQL, can be saved on the server, can also be downloaded to the local

7. mysql use phpmyadmin import, format Select SQL

8. The operation is relatively simple, to more practice, this article is a small part in the daily work commonly used to the method, I hope to help you.

Wxgzh:ludong86

AD

TODO:MONGODB MySQL Database backup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.