
# mongo
MongoDB shell version v3.6.8
connecting to: mongodb://127.0.0.1:27017
2022-04-08T13:16:33.543-0700 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2022-04-08T13:16:33.544-0700 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:257:13
@(connect):1:6
exception: connect failed
Reason:
The most common reason for Connection refused error when running the mongo command is that your mongod server is not running.
Solution:Run the mongod command to start the mongoDB server and then try the mongo command,
# mongod
2022-04-08T13:15:56.482-0700 I CONTROL [initandlisten] MongoDB starting : pid=5171 port=27017 dbpath=/data/db 64-bit host=b2391b608026
2022-04-08T13:15:56.482-0700 I CONTROL [initandlisten] db version v3.6.8
2022-04-08T13:15:56.482-0700 I CONTROL [initandlisten] git version: 8e540c0b6db93ce994cc548f000900bdc740f80a
2022-04-08T13:15:56.482-0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
..
..
2022-04-08T13:36:31.974-0700 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2022-04-08T13:36:31.975-0700 I NETWORK [initandlisten] waiting for connections on port 27017
# mongo
MongoDB shell version v3.6.8
connecting to: mongodb://127.0.0.1:27017
Implicit session: session { "id" : UUID("0e4156ce-070c-49a5-8bb9-fd43aae91bb1") }
MongoDB server version: 3.6.8
More Posts related to HowTos,
- Merge multiple zip files without unzipping (extracting)
- BSNL Broadband upgrades speed to minimum 2MBps for all users 512Kbps 1Mbps
- Static IP MTNL available at Rs. 200 per month
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document)
- How to rerun last command in Zsh shell
- [Error] There was an error connecting to the apple id server
- Command to get count of only directories [macOS/Linux/Unix]
- Turn off Focus Mode on Mac
- Fix NVIDIA GeForce Experience ERROR CODE 0x0003
- How to submit website to dmoz directory
- How to stop or quit cat command?
- How to display only IP address using Terminal command
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- [IRCTC] Indian railways official eRail API 1.1 for developers to get train info
- [Fix] Steam: Friends Network Unreachable Error
- How to replace   with space
- How to change font, apply bold or italic styles, font size in Windows Notepad
- SQL: Check if table exists
- How to identify the version of IntelliJ
- How to fix: Please check your network connection (Retry)
- Top 10 emerging breakthrough trending technologies
- 100+ SEO Tips to improve your website search ranking
- How to enable line numbers in IntelliJ
- How to write hello world different languages syntax
More Posts:
- Remove items from JavaScript array - JavaScript
- How to set background color for android layout pragmatically using java and through xml - Android
- How to open new tab in Sublime Text Editor [macOS] - MacOS
- Change Android Toast background color - Android
- C#.Net error The underlying connection was closed: An unexpected error occurred on a send - SharePoint