>>> p_connect_client.database.authenticate(DATABASE_ACCOUNT, DATABASE_PASSWROD)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\pymongo\database.py", line 730, in authenticate
self.connection._cache_credentials(self.name, credentials)
File "C:\Python27\lib\site-packages\pymongo\mongo_client.py", line 427, in _cache_credentials
auth.authenticate(credentials, sock_info, self.__simple_command)
File "C:\Python27\lib\site-packages\pymongo\auth.py", line 171, in authenticate
_authenticate_mongo_cr(username, password, source, sock_info, cmd_func)
File "C:\Python27\lib\site-packages\pymongo\auth.py", line 157, in _authenticate_mongo_cr
cmd_func(sock_info, source, query)
File "C:\Python27\lib\site-packages\pymongo\mongo_client.py", line 579, in __simple_command
helpers._check_command_response(response, None, msg)
File "C:\Python27\lib\site-packages\pymongo\helpers.py", line 147, in _check_command_response
raise OperationFailure(msg % errmsg, code)
pymongo.errors.OperationFailure: command SON([('authenticate', 1), ('user', u'xx'), ('nonce', u'db35ed307fcc204c'), ('key', u'aaaaaaaaaaaaaaaaaaaaa')])
failed: auth failed
进入到python
import pymongo
pymongo.version
查看版本号
pymongo 2.5.2 c:\python27\lib\site-packages
感觉pymongo版本有点低了,
pip install --upgrade pymongo
pymongo 3.8.0 c:\python27\lib\site-packages
再次执行,OK.