You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can connect to mongodb on my cloud server by mongodb compass and navicat, so I am sure that the username, password, host and port is correct, and the firewall configuration is correct.
But when I connect using flask-mongoengine, I get exception:
I can connect to my local mongodb without password by flask-mongoengine.
My configration is like below:
MONGODB_HOST = 'xxx.xxx.xxx.xxx'
MONGODB_PORT = 27017
MONGODB_USERNAME = 'username'
MONGODB_PASSWORD = 'p@ssword' # There is an `@` in my password, and I have tried use `%40` instead of `@` but not work
MONGODB_AUTHENTICATION_SOURCE = 'admin'
MONGODB_DB = 'my_db'
Update:
I found that it seems a bug.
If I provid individual settings, flask-mongoengine do not support authentication_source setting, cause the Authentication failed.
If I provid dictionary settings with authentication_source: 'admin' like below, connect to mongodb success.
Connection/Flask settings documentation updated in #477. Different settings options described. All options except list of dictionaries are deprecated since next version (2.0.0). Please refer to current documentation for more info and settings update.
I can connect to mongodb on my cloud server by mongodb compass and navicat, so I am sure that the username, password, host and port is correct, and the firewall configuration is correct.
But when I connect using
flask-mongoengine
, I get exception:I can connect to my local mongodb without password by
flask-mongoengine
.My configration is like below:
The versions:
Thanks!
Update:
I found that it seems a bug.
If I provid individual settings,
flask-mongoengine
do not supportauthentication_source
setting, cause theAuthentication failed
.If I provid dictionary settings with
authentication_source: 'admin'
like below, connect to mongodb success.The text was updated successfully, but these errors were encountered: