Ubuntu16.04下MongoDB的安装和使用
来源:互联网 发布:plc网络名称 编辑:程序博客网 时间:2024/06/03 07:20
MongoDB 安装
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
安装完成后,在终端输入以下命令查看MongoDB的最新版本:
mongo -version
启动、重新启动和关闭mongodb命令
- 1
- 2
- 3
- 4
- 5
- 1
- 2
- 3
- 4
- 5
查看是否启动成功
- 1
- 1
在 mongod.log 日志中若出现如下信息,说明启动成功
- 1
- 1
MongoDB 卸载
删除 mongodb 包
sudo apt-get purge mongodb-org*
删除 MongoDB 数据库和日志文件
- 1
- 2
- 1
- 2
MongoDB 使用
shell命令模式
输入mongo进入shell命令模式,默认连接的数据库是test数据库,命令如下:
xsj@ubuntu:~$ mongo
常用操作命令:
show dbs:显示数据库列表
show collections:显示当前数据库中的集合(类似关系数据库中的表table)
show users:显示所有用户
use yourDB:切换当前数据库至yourDB
db.help() :显示数据库操作命令
db.yourCollection.help() :显示集合操作命令,yourCollection是集合名
参考文档:
https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/?_ga=2.157663545.222669535.1493745656-724007558.1488558955
阅读全文
0 0
- Ubuntu16.04下MongoDB的安装和使用
- Ubuntu16.04下MongoDB的安装和使用
- ubuntu16.04下使用mongodb
- Ubuntu16.04的MongoDB安装
- ubuntu16.04下github的安装和使用
- ubuntu16.04下github的安装和使用
- ubuntu16.04下安装32位mongodb
- ubuntu16下安装mongodb 3.6
- Ubuntu16.04安装mongodb
- Ubuntu16.04安装mongodb
- Ubuntu16.04安装mongodb
- Win7下MongoDB的安装和使用
- Ubuntu下MongoDB的安装和使用
- Ubuntu下MongoDB的安装和使用
- Ubuntu16.04安装MongoDB Community 和 MongoDB C++ Driver
- Ubuntu16.04下OpenCV的快速安装和Python下的使用
- ubuntu16.04&&GPU下的pyenv&&Anaconda&&tensorflow-gpu-1.2.0的安装和使用
- Ubuntu16.04下Mongodb安装部署步骤(图文详解)
- 关于iOS多线程,我说,你听,没准你就懂了!
- Libsvm工具箱在matlab中使用的编译过程
- leetcode115. Distinct Subsequences
- 内连接 外连接(left join/ right join)
- 【业界】基于腾讯Angel的LDA*入选VLDB,超越微软LightLDA
- Ubuntu16.04下MongoDB的安装和使用
- bzoj 2321: [BeiJing2011集训]星器 乱搞
- POJ
- 剑指offer——29.最小的k个数
- 随便写写
- Executor框架简介
- Java
- 演讲实录|马晓宇:When TiDB Meets Spark
- js中json的使用