本文主要是介绍Error: Network is unreachable. Reason: couldn‘t connect to server localhost:27017(连接mongodb数据库失败),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.问题连接mogodb失败
MongoDB shell version v4.2.3
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2021-02-21T15:34:05.647+0800 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: ����Ŀ�����������ܾ��������ӡ� :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2021-02-21T15:34:05.655+0800 F - [main] exception: connect failed
2021-02-21T15:34:05.660+0800 E - [main] exiting with code 1
2.解决方案:mongod --dbpath D:\Software\mongodb\data
这篇关于Error: Network is unreachable. Reason: couldn‘t connect to server localhost:27017(连接mongodb数据库失败)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!