error('Error connecting to MongoDB:', err); }); 请确保.env文件中的ATLAS_URI是正确的,并且包含了正确的用户名、密码和数据库名。 通过以上步骤,您应该能够解决“cannot connect to mongodb. authentication failed.”的问题。如果问题依旧存在,请检查MongoDB的文档或联系数据库管理员以获取进一步的帮助。
The function is able to reach the DB but the connection is refused because apparently I need a certificate to connect to the mongoDB. I'm not using MongoDB Atlas, but Azure Cosmos DB with MongoAPI, so the links also didn't help in this case. I decided to delete all the Cosmos...
I’d greatly appreciate some help. I’m having difficulty connecting my development meteor instance to a remote mongodb atlas server. I am running version 1.8.1 as have just updated because I also couldn’t get it to work on version 1.5.1 The issue only arises when I try to set the M...
However, I've done some more testing and TLS certificates are, indeed, necessary for my use case: I'm connecting to a Mongo Atlas cluster which requires TLS/SSL - so, if they aren't available (Docker image built on FROM scratch) then I'm unable to connect to my Atlas cluster. I'...
According to https://docs.mongodb.com/manual/reference/method/rs.initiate/, "rs.initiate" can accept a "configuration" argument -- is it possible to provide the hosts list as part of that block, or does "rs.initiate" choke on that? (Worst case you could "rs.reconfig" after your "rs...
I am following the MongoDB MERN tutorial and when my front-end tries to connect to the DB to pull documents it errors out. I have pulled the official version of their GitHub repo and added my connection information and i…
I am using MongoDB Atlas/Cloud Manager which has created a replica set on AWS, which is local to my EC2 instance where my app is installed. I spent many hours trying to get this to work but it wouldn't until I removed the mongo_user:mongo_password from the connection string, after ...