작성
·
5.7K
0
{ MongooseServerSelectionError: bad auth Authentication failed.
[0] at new MongooseServerSelectionError (C:\Users\jaekyu\Desktop\boilerplate-mern-stack-master\node_modules\mongoose\lib\error\serverSelection.js:22:11)
[0] at NativeConnection.Connection.openUri (C:\Users\jaekyu\Desktop\boilerplate-mern-stack-master\node_modules\mongoose\lib\connection.js:823:32)
[0] at Mongoose.connect (C:\Users\jaekyu\Desktop\boilerplate-mern-stack-master\node_modules\mongoose\lib\index.js:333:15)
[0] at Object.
[0] at Module._compile (internal/modules/cjs/loader.js:776:30)
[0] at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
[0] at Module.load (internal/modules/cjs/loader.js:653:32)
[0] at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[0] at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[0] at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
[0] at startup (internal/bootstrap/node.js:283:19)
[0] at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
[0] message: 'bad auth Authentication failed.',
[0] name: 'MongooseServerSelectionError',
[0] reason:
[0] TopologyDescription {
[0] type: 'ReplicaSetNoPrimary',
[0] setName: null,
[0] maxSetVersion: null,
[0] maxElectionId: null,
[0] servers:
[0] Map {
[0] 'cluster0-shard-00-02.ujwdv.mongodb.net:27017' => [ServerDescription],
[0] 'cluster0-shard-00-01.ujwdv.mongodb.net:27017' => [ServerDescription],
[0] 'cluster0-shard-00-00.ujwdv.mongodb.net:27017' => [ServerDescription] },
[0] stale: false,
[0] compatible: true,
[0] compatibilityError: null,
[0] logicalSessionTimeoutMinutes: null,
[0] heartbeatFrequencyMS: 10000,
[0] localThresholdMS: 15,
[0] commonWireVersion: null },
[0] [Symbol(mongoErrorContextSymbol)]: {} }
이런 에러가 뜹니다 ㅠㅠ ㅠ
localhost:3000 으로 들어가보면
뜨긴뜨는데 로그인버튼 없이 로그아웃으로 떠버리네요ㅠ
몽고디비 접속이 제대로 안된걸까요?ㅠ
답변 4
1
1
네 ㅠ server/config/dev.js 에다가
mongodb+srv://hyeri:<password>@cluster0.ujwdv.mongodb.net/<dbname>?retryWrites=true&w=majority
password는 제가 입력한 비밀번호로 바꿔서 넣는거 맞죠?~
뒤에 dbname은 Cluster0 으로 바꿨는데도 안돼요ㅠ
0
0
아 이경우는 몽고디비가 제대로 연결이 안된 상황입니다 ~
그 몽고디비
module.exports ={
mongoURI:'mongodb+srv://account:password@waves-z0mtr.mongodb.net/test?retryWrites=true&w=majority'
}
이런식으로 dev.js 에 잘 넣어주셨나요 ~ ?
어떤 부분이 문제셨죠...?