0

couldn’t connect to server 127.0.0.1 error in mongodb

If this problem occurred in Ubuntu, try to remove the lock and repair mongo user, then restart the service:

the problem should be resolved.