MongoDB connection timeout problem Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms

Insert picture description here
Solution:
1. Change the configuration: conf:

bind_ip:0.0.0.0

Just
Insert picture description here
restart the mongod.conf service

bin/mongod -f conf/mongod.conf --shutdown
bin/mongod -f conf/mongod.conf

Enter the client

bin/mongo localhost:12345

The running code is as follows: the
Insert picture description here
Insert picture description here
above problem has been solved.

Can connect to Navicat
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43777152/article/details/109200739