9

I have a custom app that required MySql 5.6. I was able to install MySql 5.7 on ubuntu 20.04 using this tutorial: https://askubuntu.com/a/1232993

How can I install MySql 5.6 on ubuntu 20.04?

Because the above tutorial only works for MySql 5.7, and I didn't find any working solution online.

Can MySql 5.6 run on Ubuntu 20.04? Should I downgrade the OS to Ubuntu 18.04?

Pascut
  • 3,291
  • 6
  • 36
  • 64
  • Why do you need MySQL 5.6? This sounds like an [XY-problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) – Paul Spiegel Jun 15 '20 at 07:08
  • Did you try your application with MySQL 5.7? What issues you have. Most of those issues can be solved by right `sql_mode` configuration – Slava Rozhnev Jun 15 '20 at 08:01
  • The thing is that I want to install MySql for someone else, he said that he's stuck with MySql 5.6, so I don't know the exact requirements/issues. – Pascut Jun 15 '20 at 08:59
  • You need MySQL 5.6 because MySQL 5.7 is not backward-compatible with 5.6 data. Even if you're trying to do an upgrade, you need to begin with the old version. It worries me that so many people don't understand this. – Andrew Koster Oct 10 '21 at 17:41

4 Answers4

17

To install mysql 5.6.48 in Ubuntu 20:

  1. Download mysql from here
  2. unzip the tar file and install
tar xvf mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar

sudo dpkg -i *.deb
  1. it will ask you to create the root password for mysql. enter it
  2. start mysql server

sudo /etc/init.d/mysql start

Ravistm
  • 2,163
  • 25
  • 25
  • 10
    This worked for me. I hit a dependency issue (libaio1 package was required) but the installation continued and completed by running: sudo apt --fix-broken install – jamesbcn Dec 17 '20 at 09:01
  • 1
    This even works on Ubuntu 22.04 but with some changes. I now have Mysql 5.6.51 version. I deleted mysql test related deb files. Then I had to first run -> sudo apt install libaio1 libncurses5 libtinfo5 – Nikhil Jun 18 '23 at 17:07
2

I managed to install MySql 5.6 on Ubuntu 20.04 using the steps from here:

1) I downloaded the last version of MySql 5.6 that is available for Debian (and Ubuntu also)

wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar

dpkg -i mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar

mysql apt update

2) I followed the steps from here:

https://askubuntu.com/a/1030987

sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
apt-get install mysql-common-5.6 mysql-client-5.6 mysql-server-5.6

3) In order to prevent MySql to upgrade to version 8, I followed these steps:

https://askubuntu.com/a/1209971

But I replaced the MySql version with:

5.6.48-1debian9

Pascut
  • 3,291
  • 6
  • 36
  • 64
  • $ sudo dpkg -i mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar dpkg-deb: error: 'mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar' is not a Debian format archive dpkg: error processing archive mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar (--install): dpkg-deb --control subprocess returned error exit status 2 Errors were encountered while processing: mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar buddhika@pc:~$ – Buddhika Lakshan Jun 19 '20 at 06:29
  • Hi Pascut / Buddhika Lakshan - Did either of you get this working? I am getting the same error as Buddhika Lakshan. Thanks, Alan. – Alan Jul 31 '20 at 05:57
  • Depending on you Operating System, you may need to install a different package, not the Debian bundle. For me, on Linux 20 it worked with the Debian bundle. – Pascut Aug 14 '20 at 08:37
2

I have some problems when I followed the method of Ravistm`s:

$ tar xvf mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar
$ sudo dpkg -i *.deb

It say "dpkg: dependency problems prevent configuration of mysql-community-client:..."

Then I have resolved it with this method:

$ apt install libaio1 libncurses5 libtinfo5
$ apt --fix-broken install

Then mysql install continued successfully, and prompt me to set the password of mysql root account.

hhyingzi
  • 21
  • 1
0

This worked for me in ubuntu 22.04

wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.6.51-1debian9_amd64.deb-bundle.tar
tar -xvf mysql-server_5.6.51-1debian9_amd64.deb-bundle.tar
dpkg -i *.deb

apt install libaio1 libncurses5 libtinfo5
apt --fix-broken install