Yes, you can install multiple MySQL versions on your Ubuntu Server using apt-get. Here's a step by step guide on how to do that:
1. First of all, update the package list to get information on the newest versions available for upgrade:
2. Install MySQL 5.6 with this command (replace x.x.xx-debug with your specific version number):
Bash:
sudo apt install mysql-server-5.6
3. After installation, you can start the service and check its status:
Bash:
sudo systemctl start mysql
sudo systemctl status mysql
4. To ensure that MySQL will start after a reboot, enable it with this command:
Bash:
sudo systemctl enable mysql
5. Now install another version of MySQL (7.3 as an example). Use the following command (replace x.x.xx-debug with your specific version number):
Bash:
sudo apt install mysql-server-7.3
6. Enable and start this newly installed MySQL Server:
7. To check the status of the two versions you have installed, use these commands:
Remember to replace
x.x.xx-debug with your specific version number in all above commands.
Please note that if you have multiple versions installed, each will bind to a different port (MySQL 5.6 on port 3306 and MySQL 7.3 on port 3307 for example). You would need to configure the CMSs accordingly. Also, make sure your firewall is configured correctly if you are planning to use remote connections to these databases from outside of localhost.
In case you have multiple versions installed at once, you can select which version MySQL should run by using its
--defaults-file parameter. But in general we advise against running different major versions on the same server, as this could cause compatibility issues:
Bash:
sudo mysql --version5.6-debug --user=root
Replace version5.6-debug with your specific version number. In case you plan to use MySQL 7.3, replace it there too. Please ensure that the CMSs are updated as well so they can communicate properly with multiple versions of MySQL installed on server simultaneously.