# 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,
- [Fix] Error 1020 Cloudflare: Access was denied
- What is an Authorization Code Grant? OAuth 2.0
- Fix: psql: error: connection to server at localhost (::1) port 5432 failed: FATAL: database does not exist
- 100+ SEO Tips to improve your website search ranking
- How to submit website to dmoz directory
- How to check the version of NodeJS installed
- How to enter Rockstar Activation Code?
- Background task activation is spurious error - Windows 10, Office 2016, Office 365
- Angular CLI ng Error: You need to specify a command before moving on. Use --help to view the available commands
- cURL HTTP GET request command examples
- Fix - JioCinema Something Went Wrong Please Try Again Error 8001 while streaming IPL Cricket Live
- How to remove password from pdf file
- How to identify the version of IntelliJ
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- Setting up RSS feeds notifications within Outlook
- Fix - Website Connection timed out Error Code 522 (Cloudflare)
- How to fix: Please check your network connection (Retry)
- Fix: Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Accept Only 0-9 Numbers RegEx Example
- How to create a New Project in Visual Studio Code (VS Code)
- Top 10 emerging breakthrough trending technologies
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- [Error] zsh: command not found: mvn
- How to Scan iPhone for Virus? Is Antivirus it really required?
More Posts:
- Fix: bash: syntax error near unexpected token - Bash
- Java Stream Convert List of Objects to List of Strings - Java
- Install Apache Tomcat ver 8 on Mac OS X Yosemite 10.10 - Mac-OS-X
- How to access SharePoint Online data using Postman - REST API and Bearer token - SharePoint
- Check Reboot History Mac - MacOS
- How to get Client IP address using Java Code Example - Java
- How to Escape a character in a Bash command String - Bash
- [fix] Docker - no matching manifest for linux/arm64/v8 in the manifest list entries [M/M2 Mac] - Docker