본문 바로가기
에러/mongodb

[MongoDB] Username and password must be escaped according to RFC 3986, use urllib.parse.quote_plus() 에러

by PEKAH 2021. 1. 8.

몽고디비를 불러올 때 발생하는 에러로 유저네임이나 패스워드에 문제가 있을 때 발생한다.


에러

Username and password must be escaped according to RFC 3986, use urllib.parse.quote_plus()


해결

mongo_uri = "mongodb://username:" + urllib.quote("password") + "@127.0.0.1:27001/"


urllib.quote를 사용해 유저네임이나 패스워드를 따로 분리해 적용하면 된다

댓글