Pymongo는 MongoDB에 계속 로그인하지 않습니다. "루트"계정에 대한 올바른 암호를 입력했습니다. 여기Python Pymongo auth failed
Traceback (most recent call last):
File "index.py", line 3, in <module>
from apis import app
File "/home/app/apis/__init__.py", line 16, in <module>
import apis.call
File "/home/app/apis/call.py", line 12, in <module>
import auth
File "/home/app/apis/auth.py", line 18, in <module>
connection.api.authenticate(database.ADMIN_ID,database.ADMIN_PASSWD)
File "/usr/lib64/python2.6/site-packages/pymongo/database.py", line 875, in authenticate
self.connection._cache_credentials(self.name, credentials)
File "/usr/lib64/python2.6/site-packages/pymongo/mongo_client.py", line 456, in _cache_credentials
auth.authenticate(credentials, sock_info, self.__simple_command)
File "/usr/lib64/python2.6/site-packages/pymongo/auth.py", line 243, in authenticate
auth_func(credentials[1:], sock_info, cmd_func)
File "/usr/lib64/python2.6/site-packages/pymongo/auth.py", line 222, in _authenticate_mongo_cr
cmd_func(sock_info, source, query)
File "/usr/lib64/python2.6/site-packages/pymongo/mongo_client.py", line 687, in __simple_command
helpers._check_command_response(response, None, msg)
File "/usr/lib64/python2.6/site-packages/pymongo/helpers.py", line 178, in _check_command_response
raise OperationFailure(msg % errmsg, code, response)
pymongo.errors.OperationFailure: command SON([('authenticate', 1), ('user', u'root'), ('nonce', u'9e44852e6597a1de'), ('key', u'f132369d21874c9858409e235abff25f')]) failed: auth failed
는
import pymongo
connection = pymongo.MongoClient("127.0.0.1")
connection.api.authenticate("root","1234")
db = connection.api
암호에 MD5를 사용 pymongo 않습니다 pymongo입니까? mongodb 데이터에 다른 암호가있는 것처럼 보입니다.
여기 는 MongoDB를 관리 system.users 데이터{: "루트", "PWD": "cde0d84e6749c235a3b4e36d945eb6fe" "역할"[ "userAdminAnyDatabase" ] "사용자"}이다
무엇이 잘못되었는지 보시겠습니까?
업그레이드는 다음과 같은 오류에 이르게 : ConnectionError를 ("데이터베이스 % s에 연결할 수 없습니다 : \ n % s에"% (별명, E)) mongoengine.connection.ConnectionError : 데이터베이스 기본에 연결할 수 없습니다 : 거짓 읽지 않은 선호도가 아닙니다. – Shachi