How to install multiple MySQL servers in the same Virtualmin?

Operating system
Ubuntu Linux 20.04.4

Kernel and CPU
Linux 5.4.0-110-generic on x86_64

Processor information AMD EPYC 7282 16-Core Processor, 6 cores 16GB RAM

Webmin version 1.991
Usermin version 1.840
Virtualmin version 7.0-4

I want to run 2 different applications on my server. one is compatible with MySQL 5.6 and the other is the latest version.

How to install 2 different MySQL servers in the same Virtualmin?

@mr.farlish,

To run two pieces of software that operate using the same ports, you’d have to instruct one of them to use a different port number for one… You’d also have to do a more advanced install whereby you instruct one version to install into a different directory essentially the same way other software like PHP can be installed with multiple versions.

Bottom line, it is possible, though would require a “custom” install to make the above adjustments and possibly more.

2 Likes

Are you absolutely sure you need/want to do this? Most software is compatible with most recent-ish versions of the database, and making an app compatible with a newer version is usually very easy…so I lean toward recommending you stick with the version provided by your OS (8, in this case).

1 Like

Thank you for your advice. much appreciated.

Could you please guide me step by step?

Thanks, Joe.

Actually, one of my clients is using an old web-based app. They are making their app using new technology. Meanwhile, They want to use the app as it is.

I hope you will understand this situation. Can you suggest to me a proper solution?

Thanks in Advance.

Peter’s suggestion is correct if you must run both databases on the same system. The old one (since Ubuntu 20.04 has MySQL 8) will need its own port and data directory and logs, etc.

Another option you might consider is another server or VM with an older OS that has the older MySQL version for the old app. (Or having one VM just for the old database, which you connect to from your app that needs the old db.)

1 Like

Can’t we install docker container for Database Instance?
Eg: setting up and running another instance of a database server in a container, and later configuring it using System Settings ⇾ Database Servers page.?

Yep, that’d work, too. Just make sure the ports/sockets you setup don’t conflict with the system default database.

1 Like

Thanks for the positive feedback. :slight_smile:

Where can I get the Tutorial/Step by Step guide for this?

I encourage you to write one. :wink:

1 Like

Sure, I’ll when I get the solution. :wink:

However, I am not more into developer/server experts. Still looking for guidance.

I would appreciate it if someone guide me here. :pray:t2:

I don’t know what else to tell you. Everything you need to know is covered in the comments on this thread, including your own comment about the Database Servers page in Virtualmin.

@mr.farlish,

While what I stated was true in my initial response, I personally would lean as well towards @Joe’s advice.

Export data from old MySQL then import into new MySQL generally works with little to no problems.

Having multiple server versions means a more advanced installation set to maintain.

Multiple MySQL servers will cost system resources, and is highly unrecommended for most situations.

Oh and if your idea is keeping old sites using old database format for compatibility…

Start upgrading the sites as there are security and stability matters you ought to consider ahead of “trying to make old stuff work on a new system”…

Just read over that quoted statement above, red flags are raised just reading… Old on New???

I do such with a subdomain on extra box to keep to old stuff from newer box, and more safe.

I mean develop on production box (much) older and new where to many things are different then better separate it.

So subdomain to choose old or new situation.

And or same domain on extra box but for developers using a hosts file to point to right IP, is not working for all things as extarnal apps should connect… but could.

For testing / develop you can often use cheap vps somewhere.

But that is how we do it, i don’t know your situation or that from your client.

Sometime when only PHP versions for example 5.6x to 7x or 8x it is ( not modphp haha) ok to do it on the same box.

Before doing the move to other check upfront TTL time domain dns settings are short!

Looks like you manually extract the deb files and then move them to /usr/local and make the changes per the link.

http://code.openark.org/blog/mysql/manually-installing-multiple-mysql-instances-on-linux-howto

How to manually extract a deb file.

I do not recommend doing this. You will install something or do an upgrade and you’ll end up with a broken system. Use at your own risk.

That’s not how I’d go about it. I think I’d try to find, or make, a package that will put things somewhere other than the system default location. e.g. put the old version in /opt. Does the package from the MySQL folks put things somewhere other than the system default location? If so, it’d then just be a matter of updating the config to use different ports and data directories and such (maybe just changing the port…often third party packages have their own data dirs in addition to their own install location, but I have no experience with the MySQL package).

On Red Hat derived systems there is a pretty wide variety of third party repos that install into custom locations. e.g. SCL packages install into /opt, and Remi has packages that do similar.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.