码迷,mamicode.com
首页 > 数据库 > 详细

mongo数据库 启动报错

时间:2017-10-16 12:19:13      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:还需   thread   err   read   shell   mon   ref   for   soc   

报错信息如下:

[root@166 bin]# mongo
MongoDB shell version v3.4.6-22-ga109a23
connecting to: mongodb://127.0.0.1:27017
2017-10-16T10:57:28.624+0800 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2017-10-16T10:57:28.625+0800 E QUERY [thread1] Error: couldn‘t connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed

 

解决办法:

1.进入/data/db目录下,删除mongo.lock文件

2.进入/mongodb/bin目录下,执行 ./mongod

3.重新开个窗口,执行 ./mongo --dbpath=/data/platform/mongoDB/data/db/

启动时注意后面加上db路径,否则启动失败。还需要考虑权限问题。

4.至此 启动成功

mongo数据库 启动报错

标签:还需   thread   err   read   shell   mon   ref   for   soc   

原文地址:http://www.cnblogs.com/testing-BH/p/7676141.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!