mongo 连接方式

有密码连接

MONGO_CONNECT_URI = "mongodb://liquid:n3tw0rk@s-2zffffffff4.mongodb.rds.aliyuncs.com:3717," \
                    "s-2ffffdddd4.mongodb.rds.aliyuncs.com:3717/source"
#或者
MONGO_CONNECT_URI = mongodb://username:password@IP:27017/somedb?authSource=admin

 

无密码连接

MONGO_CONNECT_URI = "mongodb://127.0.0.1:27017/aiphoto"

 

posted on 2021-02-07 14:47  星河赵  阅读(440)  评论(0编辑  收藏  举报

导航