Closed pfyy closed 1 year ago
the default installation of mongodb does not listen to ipv6 localhost ::1, but node will resolve localhost to ::1, which will lead to db connection problem https://stackoverflow.com/questions/73133094/why-can-i-connect-to-mongo-in-node-using-127-0-0-1-but-not-localhost https://stackoverflow.com/questions/69957163/mongooseserverselectionerror-connect-econnrefused-127017-in-node-v17-and-mon (on my ipv6 enabled windows) mongodb default configuration is given below:
::1
localhost
# network interfaces net: port: 27017 bindIp: 127.0.0.1
the default installation of mongodb does not listen to ipv6 localhost
::1
, but node will resolvelocalhost
to::1
, which will lead to db connection problem https://stackoverflow.com/questions/73133094/why-can-i-connect-to-mongo-in-node-using-127-0-0-1-but-not-localhost https://stackoverflow.com/questions/69957163/mongooseserverselectionerror-connect-econnrefused-127017-in-node-v17-and-mon (on my ipv6 enabled windows) mongodb default configuration is given below: