Programming troubleshooting and better project development tips by Abhimanu Sharma

Use below commands to install older version of Mysql in many linux distributions like Ubuntu, Debian and Linux Mint

Install Mysql version 5.5


$ sudo apt-get install software-properties-common
$ sudo add-apt-repository -y ppa:ondrej/mysql-5.5
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.5

Install Mysql version 5.6


$ sudo apt-get install software-properties-common
$ sudo add-apt-repository -y ppa:ondrej/mysql-5.6
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.6

Install Mysql version 5.7


$ sudo apt-get install software-properties-common
$ sudo add-apt-repository -y ppa:ondrej/mysql-5.7
$ sudo apt-get update
$ sudo apt-get install mysql-server-5.7

Update : If installing any of above version throwing an error. Just create a new file under /etc/apt/sources.list.d/

sudo vi /etc/apt/sources.list.d/mysql.list

and paste below lines and save it.

deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu trusty main
deb-src http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu trusty main

And then run the command again to install the required version.
For example:

sudo apt-get update
sudo apt-get install mysql-server-5.6

If you having any questions related the same, you can comment your queries below this post.