1. Question example
Will you encounter the following problems when typing mongo in the terminal?
couldn't connect to server 127.0.0.1:27017, connection attempt failed: SockettException: Error connecting to 127.0.0.1:27017 :: caused by :: ��������������������������������� connect to ����������������� connect to server 127.0.0.1:27017, connection attempt failed: SockettException: Error connecting to 127.0.0.1:27017 :: caused by :: ������������������������������ connect to server 127.0.0.1:27017 :: caused by :: ���������������������� connect to server 127.0.0.1:27017 :: caused by :: ��������������������� connect to server 127.0.0.1:27017 :: caused by :: ��������������������� connect to server 127.0.0.1:27017 :: caused by :: �������������������� connect to server 127.0.0.1:27017 :: caused by :: �������������������� connect to server 127.0.0.1:27017 :: caused by :: Problem Analysis
In fact, this problem is not complicated, it is just because your mongodb is not started, just start it.
3. Problem Solved
Enter the bin directory of mongodb (to enter the bin directory under mongodb you installed)
-logpath (can specify the port number)
mongod --logpath "E:\Professional software\mongodb\data\log\mongodb.log" --dbpath "E:\Professional software\mongodb\data\db" --logappend
or
mongod --logpath "E:\Professional software\mongodb\data\log\mongodb.log" --dbpath "E:\Professional Software\mongodb\data\db" --logappend --port 8888
This way, the startup is successful, and you can proceed to the next step. Just open a command prompt and enter mongo.
Of course, this is just a situation, and the solution is for reference only.