How to upgrade mongoDB shell version properly on OS X - mongodb

My aim is to be able to connect myself from my local machine to a remote mongodb (version 3.2.8) instance with the following cmd:
mongo XX.XX.XXX.XXX:27017/myDB -u toto -p myPwd
i am getting this error
Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210
exception: login failed
I checked the mongoDB documentation and i understood that i have to install the same version locally
So I updated my local mongodb with brew
like it is explained here Install MongoDB Community Edition on OS X and everything ran fine
toto$ brew install mongodb
toto$ Warning: mongodb-3.2.8 already installed
but when i try that:
toto$ mongod -version
db version v2.6.6
toto$ mongo -version
MongoDB shell version: 2.6.6
it seems that i am still using the old version locally.
I also tried to install it manually like it is explained in the documentation but nothing.
So I tried to set the path for mongo in my ~/.bashrc to use the version installed with brew like that:
toto$ cat ~/.bashrc
...
# Setting PATH for MongoDb 3.2.8
export MONGO_PATH=/usr/local/Cellar/mongodb/3.2.8
export PATH=$PATH:$MONGO_PATH/bin
...
but nothing.
What am I missing or misunderstanding ...?

I finally uninstall mongodb:
brew uninstall mongodb
I also did that just in case:
remove mongodb that was installed via brew
Raw
that helped me to found out the old mongoDB version (really used) so i removed everything from my local (binaries, the export in ~/.bashrc).
I restarted the machine, re install mongodb with brew and now everything is working properly.
Don't know why i didn't try that from the begining !
I hope it will help someone.
if it is the case don't forget to up vote please :)

Related

command not found: mongo, after it's installed (OS X)

After following official instructions here to install mongo-community, it cannot find the command to start mongo.
Steps I used to install mongo:
brew tap mongodb/brew
brew install mongodb-community#3.6
The installation was successful, but when I tried to start mongo with mongo. This error appears:
zsh: command not found: mongo
Tried the solutions at Mongod: Command Not Found (OS X), none of them worked.
Also, can't seem to find where mongo is located.
Thank in advance!
Add the path to "mongo" to your terminal shell:
export PATH="$PATH:/usr/local/Cellar/mongodb-community#3.6/3.6.14/bin"
(replace version number with your local version)
It cannot find the command since $PATH is not set correctly. After MongoDB moved from open source to community liscence on Oct 16, 2018, the installation path on Mac changed. It's installed in /usr/local/Cellar (reference: Location of the mongodb database on mac).
Thanks to #kevinadi for point out the issue.
mongodb shell reference
In my case I couldn't find mongo command as 2022, so I used mongosh
and it worked fine.

Error creating strapi project using mongodb

I installed MongoDB community edition following its doc on ubuntu. Then installed strapi following its doc. Started MongoDb in terminal from command-mongod
Getting the entry
...
[initandlisten] waiting for connections on port 27017
While creating the project with default values using strapi new myStrapiProject throws the error:
and mongod log details:
it goes till connection id: 62 I don't know why. I've tried creating the project by starting MongoDb using its start, stop command but no change. I'm completely new to MongoDb and Strapi. Any help would be appreciated. I have referred this but it didn't solve my issue.
Version details:
$ mongod --version
db version v3.6.4
$ strapi --version
3.0.0-alpha.12
$ node --version
v9.11.1
$ npm --version
5.6.0
$ git --version
git version 2.7.4
check your minimum requirements for the strapi alpha 3.0.0
From the official site:
Node.js >= 10.x
NPM >= 6.x
MongoDB >= 3.x

Error trying to upgrade mongodb to version 3.6 with homebrew

I'm trying to upgrade mongodb to version 3.6. I ran brew update to get any new formulae. Then I ran brew upgrade mongodb and it complains that I already have 3.4. Is it possible to upgrade to 3.6 through homebrew, and if so, what am I doing wrong?
~: brew update
Updated 2 taps (homebrew/core, caskroom/cask).
==> New Formulae
ddgr
==> Updated Formulae
qt ✔ dialog octave suite-sparse
ansible-lint fd pyenv sundials
artifactory graphicsmagick python-markdown traefik
ceres-solver html-xml-utils reminiscence wtf
chromedriver libtiff sfk
~: brew upgrade mongodb
Error: mongodb 3.4.10 already installed
I also tried this this-morning and go the same error. I guess it is not yet available via homebrew ☹️
The mongoDB web site has a statement about it being untested on OSX 10.13:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

To make things right, you must install php_mongo module

I am not able to install the php mongo driver in a VPS. I've followed this and this documentantion
I checked this stack here but i can't figure out what I am doing wrong.
The VPS runs on PLESK 12 and CentOS 7.
lets say that I have the domain "mydomain.com" on my plesk and in mydomain.com/info.php a phpinfo script.
PHP INFO
PHP.ini
What amb I doing wrong?
The weird thing is that when I run the command "php -v" I get this output:
Which is not the version that is showing phpInfo.
Finally, I can't install the newest driver versions using pecl because I get the following error:
I would appreciate any help
Thanks!!
It's happens because you are call native OS binaries of php and pecl.
Plesk's PHP 5.6 binaries are stored in /opt/plesk/php/5.6/bin/. So you have to call /opt/plesk/php/5.6/bin/php and /opt/plesk/php/5.6/bin/pecl
Here full steps how to install mongodb for PHP 5.6:
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/pecl install mongodb
/opt/plesk/php/5.6/bin/phpize not found. Run 'yum install plesk-php56-devel' to install it
[root#cos71x64-plesk12 ~]# yum install plesk-php56-devel
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/pecl install mongodb
Build process completed successfully
Installing '/opt/plesk/php/5.6/lib64/php/modules/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.1.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
[root#cos71x64-plesk12 ~]# echo "extension=mongodb.so" > /opt/plesk/php/5.6/etc/php.d/mongodb.ini
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/php --info | grep mongo
/opt/plesk/php/5.6/etc/php.d/mongodb.ini,
mongodb
mongodb support => enabled
mongodb version => 1.1.4
mongodb stability => stable
libmongoc version => 1.3.3
mongodb.debug => no value => no value

The MongoDB PECL extension has not been installed or enabled [duplicate]

I am using Ubuntu 12.04 LTS and installed pecl in /opt/lampp/bin/ .
When installing second time its throwing error -
Command run previously -
pecl install mongo
pecl/mongo is already installed and is the same as the released
version 1.5.1 install failed
Now when I am Checking by -
echo extension_loaded("mongo") ? "loaded\n" : "not loaded\n";
It is showing not Loaded.
However I updated the php.ini with extension=mongo.so and restarted the server, but its not working.
Let me now what I am doing wrong.
EDIT
I re instantiated the command and following is the outcome -
Build process completed successfully
Installing '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/mongo.so'
install ok: channel://pecl.php.net/mongo-1.5.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
Finally with the help of Neil Lunn I made it the right way.
I added the full path and added the code at the very last line of my php.ini
extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/mongo.so"
I got the solution for xampp in ubntu linux.
If this command not work for you pecl install mongo
you should type below command
sudo /opt/lampp/bin/pecl install mongo