File tree Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,22 @@ SpringBoot集成MongoDB访问NoSQL数据库
4
4
5
5
## 安装MongoDB数据库
6
6
7
- 数据库的安装教程网上非常多,参考 [ 官网安装] ( https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/ )
8
-
9
- 配置数据库的账号和密码。
7
+ 数据库的安装教程网上非常多,我在CentOS7上面安装,版本是4.0
8
+ 参考了 [ 官网安装] ( https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/ )
9
+
10
+ 安装完成后,配置数据库的账号和密码:
11
+
12
+ ```
13
+ mongo --port 27017
14
+ use test
15
+ db.createUser(
16
+ {
17
+ user: "xiongneng",
18
+ pwd: "123456",
19
+ roles: [ { role: "readWrite", db: "test" } ]
20
+ }
21
+ )
22
+ ```
10
23
11
24
## 修改application.yml
12
25
@@ -16,7 +29,6 @@ SpringBoot集成MongoDB访问NoSQL数据库
16
29
17
30
执行对用户表增/删/改/查的测试用例:` com.xncoding.pos.ApplicationTests.java `
18
31
19
-
20
32
## 许可证
21
33
22
34
Copyright (c) 2018 Xiong Neng
Original file line number Diff line number Diff line change @@ -23,23 +23,4 @@ logging:
23
23
ROOT : INFO
24
24
com :
25
25
xncoding : DEBUG
26
- file : E:/logs/app.log
27
-
28
- ---
29
-
30
- # ####################################################################
31
- # ####################### 测试环境profile ##########################
32
- # ####################################################################
33
-
34
- spring :
35
- profiles : test
36
- data :
37
- mongodb :
38
- uri : mongodb://xiongneng:123456@localhost:27017/test
39
-
40
- logging :
41
- level :
42
- ROOT : INFO
43
- com :
44
- xncoding : DEBUG
45
- file : /var/logs/app.log
26
+ file : D:/logs/app.log
You can’t perform that action at this time.
0 commit comments