pymongo auth failed in python script

后端 未结 4 2077
不知归路
不知归路 2020-12-31 00:44

I have installed mongodb and enabled auth. and its working find. I can connect it from remote notebook using robomongo application:

Host: SERVER_IP
PORT: 270         


        
4条回答
  •  春和景丽
    2020-12-31 00:52

    Please try something like this:

    client = MongoClient("mongodb://user_name:user_password@SERVER_IP/prod-db")
    db = client['prod-db']
    

提交回复
热议问题