Mongodb Version mismatch Issue 3.6 to 4.0 upgrade - mongodb

I have installed the latest version of MongoDB i.e 4.0.10. I am using Ubuntu 18.04.
When i run mongod --version in putty command line i get version 4.0.10
But When i run query in Studio3T db.version(); i get version 3.6.3
I ran dpkg -l | grep mongo and got following output.
Please help me in identifying what i am doing wrong here.

Looks like you have two MongoDBs installed, judging from 3.6.3-0ubuntu1 installed by apt, and 4.0.10 versions there.
The page Install MongoDB Community Edition on Ubuntu stated:
The mongodb package provided by Ubuntu is not maintained by MongoDB Inc. and conflicts with the mongodb-org package. To check if Ubuntu’s mongodb package is installed on the system, run sudo apt list --installed | grep mongodb. You can use sudo apt remove mongodb and sudo apt purge mongodb to remove and purge the mongodb package before attempting this procedure.
The older 3.6.3 appears to be still running in port 27017, thus that was the one connected to by Studio3T.
To ensure a clean installation, it's better to do a clean install by:
Follow the instructions in Uninstall MongoDB Community Edition
Remove 3.6.3 using apt as per the instruction above
Reinstall using the procedure in Install MongoDB Community Edition on Ubuntu.
It's probably not required to uninstall/reinstall everything again, but you don't want to have conflicting leftover files that will create problems down the road.
If you need the data in the old 3.6.3, please do mongodump before uninstalling it. You can subsequently restore it later.

Related

Installing MySQL Client 5.6 on Ubuntu 18.04

I have a legacy project that I'm trying to modernize, and part of that involves setting up a more efficient system of automated backups using mysqldump.
The app's database is using MySQL 5.6, and is hosted via an RDS instance. To get mysqldump up and running, I believe I need to install a version of mysql-client that corresponds to 5.6.
However, running apt-get install mysql-client installs 8.0 by default. However, I can't find any version-specific versions of mysql-client available. Running sudo apt-get install mysql-client-5.7 returns a notice that there's no installation candidate available.
Is it still possible to install older versions of mysql-client? If not, is there another way to get ahold of the mysqldump functionality?
Edit: As #exussum noted below, 8.0 is backwards compatible with 5.6 and 5.7. I was hitting errors when running mysqldump, which I'd assumed indicated incompatibility, but were actually related to my app specifically.
They are backwards compatible, so you can use mysql-client 8 to dump mysql-server 5.5
to get a specific version docker is great
(sudo apt install docker) to install
docker run mysql:5.6 mysqldump
will run mysqldump though docker, and you can choose your version there easily enough

FreeBSD: upgrade MongoDB server from 2.6 to 3.0

Running MongoDB v2.6 Server on FreeBSD operating system, I am looking for a way to upgrade the MongoDB version to at least v3.0. According to MongoDB website, I need to replace the binaries but I am not able to find appropriate download binaries for FreeBSD there MongoDB download website. Alternatively I had hoped, I could upgrade the binaries using pkg package manager but I don't know which command to use to upgrade to a specific version. I am looking for something like:
pseudocode:
sudo pkg upgrade mongod v3.03
I've been crawling the web for days now to find a download link for Freebsd binaries for Version 3.0x or right upgrade command using pkg package manager.
Solution is: using the command "pkg install mongodb36-3.6.6_2" as suggested in the link by Valijon will first deinstall a previous version and then install v3.6 of MongoDB Server. Just what I was looking for.

How can I learn ubunu postgresql version as default?

When I install the ubuntu server, the postgresql repository package names are installed on server automatically. So when I type command sudo apt-get install postgresql it will start installation. But which version will be installed? I don't know it.
So how can I learn which version will be installed?

Install MongoDB on centos without YUM

I am trying to install mongodb on cent os. As mentioned in the question, I need to install it without YUM command. I downloaded the .rpm file from mongodb site. I have used rpm -ivh mongo-10gen-2.4.8-mongodb_1.x86_64.rpm command to install the .rpm. It successfully installed the mongodb. You can check the status here. I am not getting how to move forward after this ? The files mongod.conf and mongod also not getting on the system. Any help will be greatly appreciated.
The mongo-10gen-2.4.8-mongodb_1.x86_64.rpm is only MongoDB client. If you need a server, install a server package (mongo-10gen-server-X.X.X-mongodb_1.x86_64.rpm) or compile from a source.

MongoDB: Upgrade 2.4.10 to 2.6

I have a mongodb standalone instance in my ubuntu. According to official docs I replace mongod binary then I restarted mongodb using sudo service mongodb restart command, and restarted mongod binary also. Then when I check version using mongo --version. It's still 2.4.10. But when I check mongod version it's 2.6.1. Is it okay? I installed mongodb in my local machine using this guide. If it correct then I will upgrade my production server.
It sounds like you have upgraded your mongod server to 2.6.1 but still have an older version of the mongo shell in your path.
Technically that isn't a major issue for most usage as the older 2.4 shell can still connect and run common commands.
However, there are 2.6-specific shell helpers & features you'll be missing out on such as Bulk() operations and user management commands with user-defined roles.
If you have an open mongo shell, you can check the versions of both the mongo client and the mongod server you are connected to.
Ideally the major versions should match, eg:
> version() // Version of the `mongo` shell
2.6.1
> db.version() // Version of the `mongod` server this shell has connected to
2.6.1
The upgrade guide you have followed is assuming you are not using the packaged versions of MongoDB -- the guidance here could definitely be improved.
A better (and typical) approach for Ubuntu is to install MongoDB using the standard packages: Install MongoDB on Ubuntu. This would allow you to get software updates via the normal apt-get update process.
Yes. It's okay. The 2.6.1 version is a small update with bugfixes after version 2.6. But it's still the same major version.