Upgrade Mysql 5.7 to 8 “The following signatures were invalid” solution

If you are running Mysql 5.7 and would like to upgrade it to Mysql 8, here is a guide that actually WORKS for Ubuntu 18.04

wget https://repo.mysql.com//mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb

Choose mysql server and select mysql 8.0

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

If you encounter an error message like:

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

There are many sites and Q&A suggesting running: (Which does NOT work)

sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 8C718D3B5072E1F5

This will return an error like:

gpg: keyserver receive failed: No name

Idc what gnupg is cooking/upgrading or “hkp://” blah blah. It doesn’t work, it’s trash!

You should run: (According to Mysql Official Guide)

shell> sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5

Works like a charm!

 

 

 

 

If the Mysql server does not start after installation or if you see any message like:

 

Failed to start MySQL Community Server.
dpkg: error processing package mysql-community-server (--configure):
 installed mysql-community-server package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-community-server (= 8.0.26-1ubuntu18.04); however:
  Package mysql-community-server is not configured yet.

You can remove the installation by: (CAREFUL, do not remove your database and data)

sudo apt-get purge mysql\* libmysql\*
sudo apt autoremove

And reinstall it:

sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
sudo apt-get update
sudo apt-get install mysql-server

Leave a Reply

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