본문 바로가기
에러/mongodb

MongoDB 실행 에러

by PEKAH 2020. 12. 15.

MongbDB 실행 시 발생하는 에러


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


해결


sudo mkdir /data/db

sudo mongod --dbpath data/db


백그라운드 실행

sudo mongod --fork --logpath /var/log/mongodb.log

mongod --shutdown

댓글