diff --git a/springboot-mongodb/README.md b/springboot-mongodb/README.md index e00789a..9ac43c7 100644 --- a/springboot-mongodb/README.md +++ b/springboot-mongodb/README.md @@ -4,9 +4,22 @@ SpringBoot集成MongoDB访问NoSQL数据库 ## 安装MongoDB数据库 -数据库的安装教程网上非常多,参考 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/) +数据库的安装教程网上非常多,我在CentOS7上面安装,版本是4.0 +参考了 [官网安装](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/) -配置数据库的账号和密码。 +安装完成后,配置数据库的账号和密码: + +``` +mongo --port 27017 +use test +db.createUser( + { + user: "xiongneng", + pwd: "123456", + roles: [ { role: "readWrite", db: "test" } ] + } + ) +``` ## 修改application.yml @@ -16,7 +29,6 @@ SpringBoot集成MongoDB访问NoSQL数据库 执行对用户表增/删/改/查的测试用例:`com.xncoding.pos.ApplicationTests.java` - ## 许可证 Copyright (c) 2018 Xiong Neng diff --git a/springboot-mongodb/src/main/resources/application.yml b/springboot-mongodb/src/main/resources/application.yml index f135207..b21adf8 100644 --- a/springboot-mongodb/src/main/resources/application.yml +++ b/springboot-mongodb/src/main/resources/application.yml @@ -23,23 +23,4 @@ logging: ROOT: INFO com: xncoding: DEBUG - file: E:/logs/app.log - ---- - -##################################################################### -######################## 测试环境profile ########################## -##################################################################### - -spring: - profiles: test - data: - mongodb: - uri: mongodb://xiongneng:123456@localhost:27017/test - -logging: - level: - ROOT: INFO - com: - xncoding: DEBUG - file: /var/logs/app.log + file: D:/logs/app.log