mongodb插入数据报错认证失败,pymongo版本太低换成3.6版本就好 full error: {‘ok‘: 0.0, ‘errmsg‘: ‘Authentication failed.‘
环境版本问题
·
pip uninstall pymongo
pip install pymongo==3.6
输入密码
1 TypeError: ‘Collection’ object is not callable. If you meant to call the ‘authenticate’ method on a ‘Database’ object it is failing because no such method exists.
1 可以连接自己mongodb数据库。可以但无法向公司服务器插入数据。在别人电脑运行可以插入数据,因此关键在于自己环境问题。要么mongodb版本,要么pymongo版本
ret = dbtable.insert_one(student)
2 .OperationFailure: Authentication failed., full error: {‘ok’: 0.0, ‘errmsg’: ‘Authentication failed.’, ‘code’: 18, ‘codeName’: ‘AuthenticationFailed’}
mongodb插入数据报错认证失败
解决办法
删掉最新版本pymongo,我mongodb也是3.6版本的
pip uninstall pymongo
pip install pymongo==3.6
更多推荐
已为社区贡献2条内容
所有评论(0)