2

I need to install mysql 5.7 on Ubuntu 22.04. I followed the following steps :

 - wget https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb
 - sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb
 - Selected the option MySQL Server and Cluster mysql-5.7 -> ok.
 - sudo apt-get update 

The following error comes :

Err:1 http://repo.mysql.com/apt/debian jessie InRelease                                
  The following signatures were invalid: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering <mysql-build@oss.oracle.com>

 E: The repository 'http://repo.mysql.com/apt/debian jessie InRelease' is not signed.

And after running the command : "apt-cache policy mysql-server" , the list does not include 5.7

Tried to run the following commands to get the key :

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8C718D3B5072E1F5

Checked the command : sudo apt-key list It shows the mysql key is expired. Tried deleting again getting the key , but no gains

Tried the following keystores, but again no gains :

 hkp://pgp.mit.edu:80
 hkps://pgp.mit.edu
 hkps://keyserver.ubuntu.com
 hkp://p80.pool.sks-keyservers.net:80

Tried the following links : https://askubuntu.com/questions/1120363/mysql-ppa-invalid-signature/1141364#1141364

 https://stackoverflow.com/questions/73250312/how-can-i-install-mysql-5-7-on-ubuntu-22-04-lts

Kindly help

Regards Anuradha

1 Answers1

0

I have fixed this issue for me with a small trick.What we actually need to do is edit our /etc/apt/sources.list with the source.list available in Ubuntu 20.4. eg. you will get an entry in ubuntu 22 "deb http://in.archive.ubuntu.com/ubuntu/ jammy main restricted"

so just replace jammy by bionic in all places in /etc/apt/sources.list then save and try apt update after then just simply try to install myslq sudo apt install -fmysql-server=5.7* can use this command and now you can able to install mysql successfully.

Once you are installed and mysql is up and running just make sure to revert the /etc/apt/sources.list file.

Reason for doing this is in Ubuntu 22.04 it is not bale to install all required dependencies for mysql5.7 so by editing source.list we allow to install all req dependencies.

Note: Don't use upgrade in while doing this all and make sure you revert the source.list file after myslq installed and plz mark mysql on hold for upgrade because whenever you run an upgrade command it will upgrade the mysql version to 8 from 5.

Hope this work for you. Thanks