MongoDB启动时出现errno:111 Connection refused错误的解决

MongoDB启动时报下列错误

[root@MongoDB ~]# mongo
MongoDB shell version: 2.6.1
connecting to: test
2014-05-25T18:47:24.021+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-05-25T18:47:24.022+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

解决方法:

1.查看保存数据库的目录是否存在

wKioL1OBzHjyKs5eAABclOZdFyE666.jpg

2.启动MongoDB的同时指定数据库保存在什么地方

wKiom1OBzDnhZm1MAAPDhUgK7KQ342.jpg

3.再次执行mongo

wKiom1OBzETw2ILlAAEebg-mXDY367.jpg

 

你可能感兴趣的:(mongodb)