Reputation: 228
I'm using dbeaver to connect to remote mongodb server which requires username and password. I can connect to it with command mongo -u spider -p spider 10.20.88.19/spider
but failed with dbeaver.
I've tried all these Credential mechanisms but none worked. And when I use the PLAIN mechanism it says
DBException: Error connecting to Mongo instance [10.20.88.19] com.mongodb.MongoTimeoutException: MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=10.20.88.19:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=PLAIN, userName='spider', source='spider', password=, mechanismProperties={}}}, caused by {com.mongodb.MongoCommandException: Command failed with error 2: 'Unsupported mechanism PLAIN' on server 10.20.88.19:27017. The full response is { "supportedMechanisms" : ["MONGODB-CR", "MONGODB-X509", "SCRAM-SHA-1"], "ok" : 0.0, "code" : 2, "errmsg" : "Unsupported mechanism PLAIN" }}}]
And when using MONGODB-CR
DBException: Error connecting to Mongo instance [10.20.88.19] com.mongodb.MongoCommandException: MongoCommandException: Command failed with error 13: 'not authorized on admin to execute command { listDatabases: 1 }' on server 10.20.88.19:27017. The full response is { "ok" : 0.0, "errmsg" : "not authorized on admin to execute command { listDatabases: 1 }", "code" : 13 }
Upvotes: 2
Views: 3963
Reputation: 1738
You need to run the jsonListener on your DB server or app server and then connect to that jsonListenner box and port.
Upvotes: 0