Using idea to write java connection mongodb to report an error, let’s take a look at the detailed error information first
Solutions
Editor
vim mongodb/conf/mongod.conf
Add
bind_ip=0.0.0.0
After modification, the configuration file is as follows:
#Specify the start port
port=27017
#Specify the data storage directory
dbpath=data/db
#Specify the log storage directory
logpath=log/mongodb.log
#Run in the background
fork=true
#Log in with any IP
bind_ip=0.0.0.0
Causes of error information
Since mongodb version 3.6, it has_ The value of IP is localhost by default, so you can only use localhost to log in
Just change its IP to 0.0.0.0, you can use any IP login
Similar Posts:
- [Solved] MongoDB Start ERROR: child process failed, exited with error number
- How to Solve MongoDB Error: Authentication failed.
- [Solved] Mongodb Error: NETWORK [thread1] Failed to connect to 127.0.0.1:27017
- Net start mongodb error: invalid service name
- Mongovue is unable to create collections and log in with user name and password
- Mac Run MongoDB error: exception in initAndListen: NonExistentPath: Data directory /data/db not found., t…
- MongoDB:Unclean shutdown detected
- MongoDB Startup Error: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
- Mongodb access control is not enabled for the database
- Error: couldn’t connect to server 127.0.0.1:27017