while trying this mongo command in ubuntu I am getting this error.
ritzysystem@ritzysystem-Satellite-L55-A:~$ mongo
MongoDB shell version: 2.6.1
I understand the question is with regards to Ubuntu.
But if you're getting the same error on a Mac and don't want $ sudo mongod running on a separate tab, you can do the following to fix the connection error, if you have Homebrew -
brew services start mongodb
Based on the answer from this thread - Cannot connect to mongodb errno:61 Connection refused