File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## Mac上安装指定版本Mongodb
2
+
3
+ 1 . 通过[ 官网] ( https://www.mongodb.com/download-center#community ) 获取下载地址,类似:https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.9.tgz,或者直接下载好tgz格式的压缩包
4
+ 2 . cd /usr/local
5
+ 3 . 如果下载好压缩包,就解压到上述目录下。如果没下载好,就通过curl下载,sudo curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.9.tgz,并解压
6
+ 4 . 将文件夹重命名为mongodb
7
+ 5 . 添加到环境变量中
8
+ ```
9
+ export PATH=/usr/local/mongodb/bin:$PATH
10
+ ```
11
+ 6 . 创建数据存放路径
12
+ ```
13
+ sudo mkdir -p /usr/local/var/mongodb
14
+ ```
15
+ 7 . 创建日志文件路径
16
+ ```
17
+ sudo mkdir -p /usr/local/var/log/mongodb
18
+ ```
19
+ 8 . 给予上述路径读写权限
20
+ ```
21
+ sudo chown [your_name] /usr/local/var/mongodb
22
+ sudo chown [your_name] /usr/local/var/log/mongodb
23
+ ```
24
+ 9 . 运行
25
+
26
+ 后台运行
27
+ ```
28
+ mongod --dbpath /usr/local/var/mongodb --logpath /usr/local/var/log/mongodb/mongo.log --fork
29
+ ```
30
+ 如果不想在后端运行,而是在控制台上查看运行过程可以直接设置配置文件启动:
31
+ ```
32
+ mongod --config /usr/local/etc/mongod.conf
33
+
34
+ ```
Original file line number Diff line number Diff line change 9
9
5 . [ 数据库备份] ( https://supergithuber.github.io/tips/backupDatabase )
10
10
6 . [ 梅林固件无法访问软件中心] ( https://supergithuber.github.io/tips/meilinSoftwareCenter )
11
11
7 . [ pyenv无法修改Python --version显示的版本] ( https://supergithuber.github.io/tips/pyenvShowPythonVersion )
12
- 8 . [ Mysql忘记账号密码] ( https://supergithuber.github.io/tips/MysqlForgetPassword )
12
+ 8 . [ mac 安装mongodb] ( https://supergithuber.github.io/tips/installMongo )
13
+ 9 . [ Mysql忘记账号密码] ( https://supergithuber.github.io/tips/MysqlForgetPassword )
You can’t perform that action at this time.
0 commit comments