Skip to main content

Starting a MongoDB local connection in macOS

· One min read
Preet Shah

Following command starts the MongoDB server:

/Users/<username>/mongodb/bin/mongod --dbpath=/Users/<username>/mongodb-data

Example of terminal command to start MongoDB local connection with MongoDB Compass in macOS:

/Users/preetshah/mongodb/bin/mongod --dbpath=/Users/preetshah/mongodb-data

This command takes you to the MongoDB path and starts the MongoDB server.

References