MongoDB Compass connect ECONNREFUSED

Hello. I am new to MongoDB and using as it is part of a LYNDA course. I am running on MacOS. I am getting
“connect ECONNREFUSED” error message. Not really sure where to take from here and would appreciate suggestions.

Most likely you do not have a server running at

How did you start mongod?

You can check if you have a local mongod running by using ps piped into grep.

jd10gen:~ jdrumgoole$ ps -alx | grep mongod
  501 59462 43689     4006   0  31  0  5565448  30692 -      S+                  0 ttys000   11:13.09 mongod --dbpath data
  501 43892 35381     4006   0  31  0  4287756    744 -      S+                  0 ttys002    0:00.00 grep mongod
jd10gen:~ jdrumgoole$

If mongod is running you will get two lines, if not, one line. To start a mongod process just run:

$ mkdir $HOME/data
$ mongod --dbpath $HOME/data

This assumes mongod is on your path. To download and install mongod goto and download the installation package
for MongoDB on OSX (MacOS).