'i am using Mongodb server i get the error how can i solve this?
i am using Mongodb server i get the error how can i solve this?
MongoServerError: bad auth : Authentication failed. at Connection.onMessage (E:\website Projetcs\electro-gadget-tech-server\node_modules\mongodb\lib\cmap\connection.js:203:30) at MessageStream. (E:\website Projetcs\electro-gadget-tech-server\node_modules\mongodb\lib\cmap\connection.js:63:60) at MessageStream.emit (node:events:527:28) at processIncomingData (E:\website Projetcs\electro-gadget-tech-server\node_modules\mongodb\lib\cmap\message_stream.js:108:16) at MessageStream._write (E:\website Projetcs\electro-gadget-tech-server\node_modules\mongodb\lib\cmap\message_stream.js:28:9) at writeOrBuffer (node:internal/streams/writable:390:12) at _write (node:internal/streams/writable:331:10) at Writable.write (node:internal/streams/writable:335:10) at TLSSocket.ondata (node:internal/streams/readable:766:22) at TLSSocket.emit (node:events:527:28) { ok: 0, code: 8000, codeName: 'AtlasError', [Symbol(errorLabels)]: Set(0) {}
Solution 1:[1]
This means the user/pwd combination is not correct.
I recommend you this steps:
console.log() your connection string (URI) so you can see what the information send is. (Do not paste it here bc we can hack you down).
Check that the user exist in the database (either in Atlas for cloud or Mongosh for local, for example).
If it does not, you may need to create a new user.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mah Neh |
