2

I downloaded mongodb-bin and mongodb-tools-bin in AUR.I just typed sudo systemctl enable mongodb and just ran mongo.This is the error i got:

$ mongo
MongoDB shell version v5.0.5
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 :: Connection refused :
connect@src/mongo/shell/mongo.js:372:17
@(connect):2:6
exception: connect failed
exiting with code 1

I saw somebody say to just delete /var/lib/mongodb/mongod.lock but when i checked there was no mongod.lock file

RadonjicVuk
  • 21
  • 1
  • 5

1 Answers1

0

I have fixed the problem by deleting /tmp/mongodb-27017.sock.I have found the answer here

RadonjicVuk
  • 21
  • 1
  • 5