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.
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).
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?
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.)
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.?
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.
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!
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.