Home > Database > Mysql Tutorial > MongoDB配置脚本

MongoDB配置脚本

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:09:07
Original
1084 people have browsed it

关于mongoDB的安装与配置,mongo官网上已经有很详细的介绍了,这里仅列一下自己配置mongoDB的一些脚本,仅供参考--进入bin目录mo

关于mongoDB的安装与配置,mongo官网上已经有很详细的介绍了,这里仅列一下自己配置mongoDB的一些脚本,仅供参考

--进入bin目录
mongod -dbpath "d:\mongodb"

--安装window服务
用—dbpath参数指出了数据库的目录,,--logpath则指出了日志存放的目录,而—serviceName参数则指出了命令安装的服务名为MongoDB
mongod --logpath d:\mongodb\log --logappend --dbpath d:\mongodb --directoryperdb --install
--删除服务
mongod -remove -serviceName "MongoDB"

--数据库操作脚本,来自官网
C:\> cd \my_mongo_dir\bin
C:\my_mongo_dir\bin> mongo
> // the mongo shell is a javascript shell connected to the db
> // by default it connects to database 'test' at localhost
> 3+3
6
> db
test
> // the first write will create the db:
> db.foo.insert( { a : 1 } )
> db.foo.find()
{ _id : ..., a : 1 }
> show dbs
...
> show collections
...
> help
--创建数据库 user newDatabaseName
> use xiaodb
switched to db mkyongdb
> show dbs
admin   0.03125GB
local   (empty)
--定义collection,然后插入数据
db.users.save( {username:"xiao"} )
--查找插入数据
db.users.find()
--修复命令
mongod –repair

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template