How to Install MySQL 5.7 on Ubuntu 22.04

MySQL 5.7 is not supported on Ubuntu 22.04, but you can download MySQL 5.7 for Ubuntu 18.04 and install it on Ubuntu 20.04 or Ubuntu 22.04

First, install libtinfo5, this is available for download from https://launchpad.net/ubuntu/bionic/amd64/libtinfo5/6.1-1ubuntu1.18.04

cd ~/
wget http://launchpadlibrarian.net/371711898/libtinfo5_6.1-1ubuntu1.18.04_amd64.deb
dpkg -i libtinfo5_6.1-1ubuntu1.18.04_amd64.deb

The files are moved from the Offical MySQL site

https://dev.mysql.com/downloads/mysql/5.7.html

So we will download it from a mirror site. If the mirror is down, you can search with the .deb file name to find another mirror.

mkdir ~/mysql57
cd ~/mysql57
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/libmysqlclient-dev_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/libmysqlclient20_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/libmysqld-dev_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-client_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-common_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-community-client_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-community-server_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-community-source_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-community-test_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-server_5.7.38-1ubuntu18.04_amd64.deb
wget https://mirror.csclub.uwaterloo.ca/mysql/Downloads/MySQL-5.7/mysql-testsuite_5.7.38-1ubuntu18.04_amd64.deb
dpkg -i *.deb
apt install -f

To start MySQL on boot, run

systemctl enable mysql

To start MySQL, run

systemctl start mysql

Back to MySQL Installation

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *