Error

[ Mongo DB ] URI must include hostman, domain name, and tld

dltjdn 2022. 5. 2. 15:31

Error

$ yarn run dev
yarn run v1.22.18
$ nodemon
[nodemon] 2.0.15
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src\**\* .env
[nodemon] watching extensions: js,ts,json
[nodemon] starting `ts-node  --transpile-only ./src/index.ts`

    ################################################
          🛡️  Server listening on port 🛡️
    ################################################
 

URI must include hostman, domain name, and tld

[nodemon] app crashed - waiting for tile changes before starting...

 

 

원인

Mongodb 계정 비밀번호에 포함된 특수문자가 인코딩되면서 발생한 에러

 

 

해결방안

1. MongoDB atlas ( https://www.mongodb.com/cloud/atlas/lp/try2?https://www.mongodb.com/cloud/atlas/lp/try2-aterms&utm_source=google&utm_campaign=gs_apac_south_korea_search_core_brand_atlas_desktop&utm_term=mongodb%20atlas&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624365&adgroup=115749706543&gclid=Cj0KCQjw37iTBhCWARIsACBt1IyaT2Du9VICva1gIEPyH5lj5WPln2RcVSE91cx0fgWl0qrgPnBhvwgaAgvGEALw_wcB ) 에 접속

 

2. Database Access 에서 Actions의 EDIT 클릭하여 특수문자가 들어가지 않은 비밀번호로 변경해준다

 

그럼 아래와 같이 mongoDB가 제대로 연결된다!

결론 : MongoDB 비밀번호에는 특수문자가 들어가면 안된다!