mongodb 建库过程(ubuntu shell 版)
来源:互联网 发布:趣店入职配mac 编辑:程序博客网 时间:2024/06/12 00:22
mongodb安装过程:http://blog.chinaunix.net/uid-29454152-id-5567669.html
1。开启数据库:
数据库的配置内容已经在/etc/mongod.conf 中配置好,参考链接:https://docs.mongodb.org/manual/reference/configuration-options/
2。登录数据库:
3。建立新库:
4。为新库创建用户:
5。登录新库:
6。建立集合:
7。为集合插入新内容:
参考链接:
用户管理:https://docs.mongodb.org/manual/reference/method/js-user-management/
用户角色:https://docs.mongodb.org/manual/reference/built-in-roles/#built-in-roles
shell方法:https://docs.mongodb.org/manual/reference/method/#user-management-methods
认证开启:https://docs.mongodb.org/manual/tutorial/enable-internal-authentication/
1。开启数据库:
数据库的配置内容已经在/etc/mongod.conf 中配置好,参考链接:https://docs.mongodb.org/manual/reference/configuration-options/
点击(此处)折叠或打开
- sudo mongod --config /etc/mongod.conf
2。登录数据库:
点击(此处)折叠或打开
- sudo mongo -u username-p pwd --authenticationDatabase"dbname"
点击(此处)折叠或打开
- use yourNewDBName
4。为新库创建用户:
点击(此处)折叠或打开
- > db.createUser(
- ... {
- ... user:"name"
- ... pwd:"pwd"
- ... roles:[{role:"readWrite", db:"lab"},
- ... {role:"dbOwner", db:"lab"}
- ...]
- ... }
- ...)
点击(此处)折叠或打开
- db.auth("name","pwd")
点击(此处)折叠或打开
- db.createCollection("collectionName")
7。为集合插入新内容:
点击(此处)折叠或打开
- db.students.insert()
参考链接:
用户管理:https://docs.mongodb.org/manual/reference/method/js-user-management/
用户角色:https://docs.mongodb.org/manual/reference/built-in-roles/#built-in-roles
shell方法:https://docs.mongodb.org/manual/reference/method/#user-management-methods
认证开启:https://docs.mongodb.org/manual/tutorial/enable-internal-authentication/
0 0
- mongodb 建库过程(ubuntu shell 版)
- Ubuntu 安装 MongoDB 详细过程
- mongodb-shell
- MongoDB Shell
- mongodb shell
- MongoDB Shell
- mongodb shell
- mongodb无法登陆(ubuntu)
- MongoDB源码安装(Ubuntu)
- 学习MongoDB--(2-2):MongoDB入门(Shell基本操作)
- 初识MongoDB(三)--MongoDB客户端Shell方式访问
- MongoDB学习(三):MongoDB Shell的使用
- MongoDB学习(三):MongoDB Shell的使用
- MongoDB学习(三):MongoDB Shell的使用
- MongoDB学习(三):MongoDB Shell的使用
- mongodb(二)-- mongodb shell及基本操作
- (转载)五 MongoDB交互shell
- MongoDB 学习二(shell 基本操作)
- 深入理解Python的字符编码utf-8 & unicode
- 字符编解码的故事(ASCII,ANSI,Unicode,Utf-8区别)
- urllib2中的两个重要概念 Openers和Handlers
- python模拟登录微博网站利用urllib2 和 cookie
- 开启MongoDB不能访问web控制台问题;; access MongoDB over HTTP
- mongodb 建库过程(ubuntu shell 版)
- C#中的Dictionary字典类介绍
- mongodb C/C++ driver 通过帐号验证登录mongo服务器并进行相应操作
- mongodb 的 C++驱动安装过程以及注意问题
- 关闭 mongodb 出错: Error: shutdown failed: not authorized
- 局部敏感哈希(Locality-Sensitive Hashing, LSH)方法介绍
- 'Building workspace' has encountered a problem.Errors occurred during the build.
- NYOJ1016(德莱联盟)(判断线段相交)
- Navicat 错误代码ORA-28547