Problem connecting from Mongo through Shell command in Mac

I am following the Developer certificate course. From the Chapter 2, I followed the video to install mongo shell.
When I type in the connection command, I get following error and do not connect to cluster.

mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/100YWeatherSmall?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics

MongoDB shell version v4.0.5

connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/100YWeatherSmall?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0

2019-01-11T05:50:19.654+0530 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017

2019-01-11T05:50:20.980+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to cluster0-shard-00-00-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-jxeqq.mongodb.net:27017 with a 5 second timeout)

2019-01-11T05:50:20.980+0530 I NETWORK [js] Successfully connected to cluster0-shard-00-01-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-01-jxeqq.mongodb.net:27017 with a 5 second timeout)

2019-01-11T05:50:22.516+0530 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to cluster0-shard-00-02-jxeqq.mongodb.net:27017 (1 connections now open to cluster0-shard-00-02-jxeqq.mongodb.net:27017 with a 5 second timeout)

Implicit session: session { “id” : UUID(“3d4c9fc5-5e09-4484-8d63-3a360d0bceed”) }

MongoDB server version: 3.6.9

WARNING: shell and server versions do not match

2019-01-11T05:50:26.666+0530 I STORAGE [main] In File::open(), ::open for ‘/Users/Harish/.mongorc.js’ failed with Permission denied

The “.mongorc.js” file located in your home folder could not be executed

Hi Harishalwala,

Thanks for reaching out.

Only one thing coming to my mind after reading this error. Please check the permission on .mongorc.js file through below command. And for example, if my `owner=kanika on the file, then you are running the command from kanika user only when executing mongo command.

~$ ls -l ~/.mongorc.js 
-rw-------  1 kanika  staff     0B Jul 17 20:07 /Users/kanika/.mongorc.js

Let me know if that helps.

Kanika

Thanks ‘kanikasingla’ for the response.

I have given full permissions for /.mongorc.js and also for .dbshell file.
Only then I could get version correct and could able to connec to the cluster.

Regards
Harish