How to install 3 different versions fo mysql in a single instance(Ubuntu)

I need to install 3 different versions of mysql-server in a single instance(Ubuntu). 1. MySQL server 5.6.24 2. MySQL server 5.6.32 3. MySQL server 5.7 latest release

Can anyone tell me the process to install all the above versions.

1 Answer

I can't see how to do so using the traditional apt setup so I found this solution which uses docker to install as many versions of mysql on your ubuntu instance:

Steps:

  1. Install default mysql using apt:

    sudo apt install sudo apt-get install mysql-server-5.7 mysql-server-core-5.7 mysql-client-5.7 mysql-client-core-5.7
  2. The install docker:

    curl -sSL | sh
  3. Install the version of mysql you want and assign it to a different port:

    sudo docker run --name mysql-56-container -p 127.0.0.1:3310:3306 -e MYSQL_ROOT_PASSWORD=rootpassword -d mysql:5.6
    • 127.0.0.1:3310:3306 forwards port 3306 on docker to port 3310 on host

Now you have both mysql 5.7, and 5.6 connection can be made like thus:

  1. To docker image:

    mysql -u root -p --host=127.0.0.1 --port=3310
  2. To host mysql:

    mysql -u root -p

Please note I used fictitious mysql instances your will vary.

Further information:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like