MongoDB database maintenance operations: Connection amp; User Management amp; backup, mongodb DatabaseStart/Close the mongodb ServiceStart the serviceThe mongodb service can be started directly by specifying the startup paramete
Configure MongoDB configuration items in the configuration file and back up and restore the database, mongodb backup and recoveryI. mongoDB command line startup option Configuration
When mongodb is started using the command line,
Label:One, Mongodump backup database 1, Common command grid
1
mongodump -h IP --port 端口 -u 用户名 -p 密码 -d 数据库 -o 文件存在路径
If there is no user who can remove-u and-P. If you export the native database, you can remove-H. If it is the default port, you can remove--port. If you want to export all databases, you can remove-D. 2. Export al
Tag: base font size Field No query exp NTS index CINOriginal: http://www.jb51.net/article/52498.htmOne, Mongodump backup database 1, Common command grid?
1
mongodump -h IP --port 端口 -u 用户名 -p 密码 -d 数据库 -o 文件存在路径
If there is no user who can remove-u and-P.If you export the native database, you can remove-H.If it is the default por
MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library mongoexport and Mongoimport.One, Mongodump backup database1, Common command gridMongodump-h IP--port Port-u user name-p password-d database-o file exists pathIf the
One, Mongodump backup database
1, Common command grid
Mongodump-h IP--port Port-u user name-p password-d database-o file existence path
If there are no users who can remove-u and-P.If you export the database for this computer, you can remove-H.If it is the default port, you can remove the--port.If you w
Mongodb database backup and recovery in windowsI can talk about data backup to the c: \ data \ dump directory, first create this path. Go to the bin directory of mongodb.Mine is:C: \ Program Files \ mongodb \ binThe backup script
can use the header of the first row as the imported field --file: the file to import 2, example: sudo mongoimport-d mongotest-c users--file/home/mongodump/arti Cles.json--type JSON -------------------MongoDB Backup and Recovery-------------------1, MongoDB database bac
Mongorestore toolsMongoDB also provides backup and recovery capabilities, respectively, Mongdump.exe and Mongorestore.exe files in the MongoDB download directory.First introduce the following command syntax:>mongodump - H dbhost- D dbname- o dbdirectory-H:MONGDB the server address, for example: 127.0.0.1, you can also specify the port number: ip:27017-D: The database
Tag:home backup and Recovery ctiresgdb gpo output export filename -------------------MongoDB Data Import and Export-------------------1, export tool: Mongoexport 1, Concept: The Mongoexport tool in MONGODB can export a collection to a file in JSON or CSV format. You can specify the exported data item by parameter, or you can export the data based on the
format default JSON N Bsp -F: Imported field names --headerline: If the imported format is CSV, you can use the header of the first row as the imported field NB Sp --file: Files to import 2, example: sudo mongoimport -D mongotest-c users--file/home/mongodump/articles.json--type json ------------------- MongoDB Backup and Recovery-------------------1,
It's written in front.
This article has already assumed that you have installed the MongoDB (2.6) and has opened the auth.
User
First we add the users needed to back up and recover the data, and this user needs to have ReadWrite and Useradmin permissions
Copy Code code as follows:
$ MONGO
$ use admin
$ db.auth ("admin", "youradminpasswd");
$ use backupdb
$ db.adduser ({User: "Backup
--fileUser_csv.datConnected to:127.0.0.1Imported 3 objects[Email protected] bin]#Parameter description:-type indicates the file format to import-headerline The first row is not imported because the first row is a column name-file indicates the file path to importAttention: The CSV format is good and the mainstream database supports the export to CSV format, so this format is very beneficial for heterogeneous data migration --------------------
use the header of the first row as the imported field--file: The file to import2、示例: sudo mongoimport -d mongotest -c users --file /home/mongodump/articles.json --type json-------------------MongoDB Backup and Recovery-------------------1. MongoDB Database backup1. Syntax:Mongodump-h dbhost-d Dbname-o dbdirectoryPa
1. Exporting datamongoexport-d my_mongodb-c Choice-o Choice.datParameter description:-d indicates which library to use, in this case "My_mongodb"-C indicates the table to be exported, in this case "choice"-O indicates the name of the file to be exported, in this case "choice. Dat"-H Server Address2. Import datamongoimport-d my_mongodb-c choice choice. datParameter description:-d indicates which library to use, in this case "My_mongodb"-C indicates the table to be imported, in this case "choice"3
Tags: backup Use bin tab database dump head post showEnvironmental win10; Run the CMD CD into the directory MongoDB Bin directory: To connect to a remote MongoDB: Connection command: Mongo-u username-p pwd host:post/database (database
Label:First introduce the following command syntax: ./mongodump-h 127.0.0.1:10001-d Lietou-o/usr/local/data -H:MONGDB the server address, for example: 127.0.0.1, you can also specify the port number: 127.0.0.1:10001 -D: The database instance that needs to be backed up, for example: Lietou -O: The data storage location of the backup, for example:/usr/local/data, after the
Label:MongoDB data backup and restore is mainly divided into two kinds, one is for the library of Mongodump and Mongorestore, one is for the table in the library mongoexport and Mongoimport. One, Mongodump backup database 1, Common command grid Mongodump-h IP--port Port-u user name-p password-d database-o file exists p
Tags: mongod database BSP backup file export save files--useExport of databasesmongoexport-d database name-C collection name----Save address of export file and save file name. JSON--type JSONImport of databasesmongoimport-d database name-C collection name--file the file address and filename to prepare for import. JSON-
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.