简体   繁体   中英

MongoDB MongoDB connection error: MongoError: connect ECONNREFUSED 127.0.0.1:27017 error when my router is turn off

whenever my router goes off ... my mongod connection dont work . I had power cut twice and found this error while starting my application. Once my router was up I was able to reconnect mongo db

MongoDB connection error: MongoError: connect ECONNREFUSED 127.0.0.1:27017 while wifi router is off.

Have you tried to change the mongo-connection?

Change your connection string from localhost to ip: mongodb://localhost/test to mongodb://127.0.0.1:‌​27017/test

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM