赞
踩
转载自https://www.cnblogs.com/melonjiang/p/6536876.html
pip install pymongo
mkdir -p /home/tools
cd/home/tools
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.2.tgz
tar -zxvf mongodb-linux-x86_64-3.4.2.tgz
mv mongodb-linux-x86_64-3.4.2 mongodb3.4.2
ln -s mongodb_3.4.2 mongodb
sudo vi ~/.profile
export PATH=/home/tools/mongodb/bin:$PATH
mkdir -p /data/db
./mongod --dbpath /data/db
./mongo
# ./mongo
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.2
Welcome to the MongoDB shell.
.....................
times number of files.
2017-03-12T01:15:04.901+0800 I CONTROL [initandlisten]
>
> mongodb://admin:123456@localhost/
...
... use test
2017-03-12T01:34:04.361+0800 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):3:4
> use test
switched to db test
> db
test
> show dbs #查看所有数据库
admin 0.000GB
local 0.000GB
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。