Installing MySQL client 5.7 in Ubuntu Focal 20.04
TLDR;
- download the client from https://dev.mysql.com/downloads/mysql/
- install dependencies
sudo apt install libaio1 libtinfo5
- install the client
sudo dpkg -i mysql-community-client_5.7.30-1ubuntu18.04_amd64.deb
- check the client version
$ mysql --version
mysql Ver 14.14 Distrib 5.7.30, for Linux (x86_64) using EditLine wrapper
As you may have gleaned from the Docker Compose configuration I showed last time, my team uses MySQL 5.7 Community Edition. It works well for us, and we don’t really have any urgent reason to upgrade to MySQL 8, so we decided not to rock the boat with an upgrade (at least without a proper migration plan).
I just installed Ubuntu Focal on a Clevo NH57AF1, and it does not have MySQL 5.7 binaries in its repositories. Although the version 8 client can work with a MySQL 5.7 server, MySQL schema dumps include extra changes that mess with our version tracking. We keep schema dumps checked in to make sure that each developer can reset their database to the standard schema.
It’s not too difficult to install an older version of MySQL, but it’s not a walk in the park either. You’ll first have to download the community client from https://dev.mysql.com/downloads/mysql/. It will not show any of the older versions by default; you’ll need to click on the link that says, “Looking for the latest GA version?”
Then you’ll get three dropdowns; select the latest version, Ubuntu Linux as the operating system, and 18.04 (x86, 64-bit) as the OS version (or whichever architecture you’re running).
There are a number of downloads to choose from; the one I needed was the community client (but it’s not labeled as such; you’ll need to check the filename). After that, it’s just a matter of installing some dependencies like libaio1 and libtinfo5, and then installing the .deb file that was just downloaded.