mongo链接报错:couldn't connect to server 127.0.0.1:27017 (127.0.0.1)

angela@angeladeMacBook-Air:/data/db$mongo
MongoDB shell version: 2.6.1
connecting to: test
2014-06-07T11:13:21.349+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2014-06-07T11:13:21.350+0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

mongo数据库数据存放的默认位置是/data/db

angela@angeladeMacBook-Air:/data/db$rm mongod.lock
angela@angeladeMacBook-Air:/data/db$mongod --dbpath="/data/db"

-------------------------------------------------------------------------------------------------------------------------------------

欢迎来到我的博客, 本人乃互联网行业一枚小小的螺丝钉—非典型程序员妹子.

留下微信地址,方便大家和我联系

mongo链接报错:couldn't connect to server 127.0.0.1:27017 (127.0.0.1)

上一篇:TCP/IP详解学习笔记- 概述


下一篇:GCD之异步同步体会