System: centos7
mongo client: mongo2.6.12
mongo server: mongo3.6
Connection error:
2018-07-02T11:51:48.904+0800 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18, codeName: "AuthenticationFailed" } at src/mongo/shell/db.js:1292
exception: login failed
Reason: Due to the low version of Mongo Client, the authentication mechanism is not supported, resulting in client authentication failure.
Solutions:
sudo yum remove mongodb
sudo yum remove mongodb-server
Install Mongodb3.6 version
Refer to CentOS 7 to install MongoDB 3.6
After successful installation, according to the authentication mechanism set by the server, select scRAM-SHA-1 or MongoDB-CR, and default to SCRAM-SHA-1
Connection command:
mongo -authenticationDatabase admin -u user -p pass -host hostname -port 27017 [--authenticationMechanism SCRAM-SHA-1]
div>
Read More:
- Mongodb uses Mongo to report error: could’t connect to server 127.0.0.1:27017, connection attempt failed: socket
- Window installation of MongoDB exception: connect failed exception
- Spring boot integrates Mongo to solve some common connection and permission problems. Docker compose installs Mongo
- Command failed with error 16412: ‘FieldPath field names may not contain ‘.‘.‘ on server 10.21.20.8:2
- The mongoDB service failed to start (exception: connect failed)
- MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect EC
- [Solved] org.mongodb.driver.cluster – Exception in monitor thread while connecting to server node1:27017
- Mongodb failed to start: child process failed, exited with error number 100
- Error: could’t connect to server 127.0.0.1:27017, connection attempt failed
- MongoDB Error: Failed to start mongod.service: Unit mongodb.service is masked
- Simple understanding and basic operation of mongodb
- Mongodb start error: child process failed, exited with error number 1
- MongoDB Error: Failed to start mongod.service: Unit mongod.service is not loaded properly
- dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
- error:Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused;error:couldn‘t ….
- 【MongoDB】 Failed to connect to 127.0.0.1:27017, reason: Connection refused
- Error in Python connection to mongodb pymongo.errors.OperationFailure : Authentication failed.
- MongoDB:Failed: error connecting to db server: no reachable servers
- Error: child process failed, exited with error number 1
- MongoNetworkError: failed to connect to server [localhost:27017]