Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodb 学习笔记 #29

Open
sakila1012 opened this issue Aug 6, 2018 · 0 comments
Open

mongodb 学习笔记 #29

sakila1012 opened this issue Aug 6, 2018 · 0 comments

Comments

@sakila1012
Copy link
Owner

sakila1012 commented Aug 6, 2018

安装

  1. 安装mongodb,最新版的commuity版已经可以可视化,但安装的过程中会卡死,因为安装源的问题,所以在安装的过程中,选择安装custom,点击下一步,通过去掉compass。这样就可以避免安装过程中卡死问题。

配置环境变量

2.安装成功后,配置环境变量

  1. 在你的计算机上创建一个目录,用于存放MongoDB数据库文件的文件夹

  2. 执行命令

mongod --dbpath D:\mongodb

default

数据库的导入和导出

  1. 数据库的导入和导出
    导出
mongodump -h dbhost -d dbname -o dbdirectory

例如:mongodump -h 127.0.0.1 -d koa -o d:\koa (Windows环境)

导入

mongorestore -h dbhost -d dbname path

例如:mongorestore -h 127.0.0.1 -d koademo d:\koa\koa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant