'Mongolab connection error

I'm getting the following message when I try connecting to MongoLab with the command:

mongo ds035438.mongolab.com:35438/comeventsbw -u (myusername) -p (mypassword)

MongoDB shell version: 3.0.6 connecting to: ds035438.mongolab.com:35438/comeventsbw 2015-12-10T10:30:18.537-0700 I STORAGE In File::open(), ::open for '/Users/benwong/.mongorc.js' failed with errno:13 Permission denied The ".mongorc.js" file located in your home folder could not be executed



Solution 1:[1]

You can try to delete the root directory .mongorc.js file. To do this in mac OS you can use cd ~/&&ls -al, if you see .mongorc.js that is owned by root, so we can use sudo rm .mongorc.js to delete it.

Solution 2:[2]

I got the same error in Ubuntu-18. Initially I logged in as normal user. I typed mongo on the terminal. So I got same above error. So I switched to the root user using sudo -s This time when I typed mongo command on the terminal I'm able to connect mongo server. So I thought this service is not available for the normal user.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris Britt
Solution 2 Kodali444