天天看點

couldn‘t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error conne

問題描述

指令行中使用mongo指令出現:

MongoDB shell version v4.4.2

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

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 :: ����Ŀ�����������ܾ����޷����ӡ� :

[email protected]/mongo/shell/mongo.js:374:17

@(connect):2:6

exception: connect failed

exiting with code 1

couldn‘t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error conne

解決方案

windows(菜單鍵)+R輸入services.msc

couldn‘t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error conne

在服務視窗中找到

couldn‘t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error conne

右鍵開啟服務

重新輸入mongo指令

couldn‘t connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error conne

成功啟動

繼續閱讀