开发者

Pymongo gives db assertion failure while trying to access remote server

开发者 https://www.devze.com 2023-03-18 02:55 出处:网络
I am getting the following error: db assertion failure, assertion: \'unauthorized db:db1 lock type:-1 client:\', assertionCode: 10057

I am getting the following error:

db assertion failure, assertion: 'unauthorized db:db1 lock type:-1 client:', assertionCode: 10057

I am able to ac开发者_开发技巧cess the MongoDB database by running python on the shell of my server. But when I try to access my site i get this unauthorised errors.

Any fix for this error?


This means that your database is using authentication. In such a setup, you must authenticate a valid user before you can perform any operations (queries, commands, updates, etc). You can do so with the db.auth(username, password) helper in the mongo shell (described in the MongoDB docs), and with Python, you can use the authenticate(username, password) method of the Database object (described in the PyMongo docs)

0

精彩评论

暂无评论...
验证码 换一张
取 消