设为首页 加入收藏

TOP

ubuntu下mongodb安装
2014-11-24 03:05:25 来源: 作者: 【 】 浏览:1
Tags:ubuntu mongodb 安装

1. 下载mongodb,到官网下载最新的稳定版本:http://www.mongodb.org/downloads
2.解压下载的包 tar -zxvf mongodb-linux-i686-2.0.4.tgz
3.mongodb默认的数据存储路径是/data/db/ 所以先创建目录 mkdir /data/db
4.运行 ./bin/mongod启动服务。
5.运行 ./bin/mongo 启动shell,通过java script shell可以操作 数据库
相关命令如下:
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
use set curent database to
db.help() help on DB methods
db.foo.help() help on collection methods
db.foo.find() list objects in collection foo
db.foo.find( { a : 1 } ) list objects in foo where a == 1
it result of the last line eva luated; use to further iterate
在MongoDB中,在使用Database或Collection前不需要提前创建,在使用的过程中会自动创建。
更多使用详见官网:http://www.mongodb.org/display/DOCS/Tutorial

作者 linmomo02
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇hadoop下ssh的配置 下一篇Linux中SQLplus上下键不能显示历..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)
·索引堆及其优化 - 菜 (2025-12-24 20:18:50)
·Shell 中各种括号的 (2025-12-24 19:50:39)
·Shell 变量 - 菜鸟教 (2025-12-24 19:50:37)