4

I have a Drupal site 8.6.10 on an Ubuntu server 18.04 with MySQL 5.7.25

I want to update MySQL to version 8.0

Here are the steps I followed :

1) I backed up my database.

2) I uninstalled MySQL from my server with the commands :

$ sudo systemctl stop mysql
$ sudo apt remove mysql-*
$ sudo apt purge mysql-*
$ sudo apt autoremove
$ sudo dpkg -l | grep mysql | grep ii

3) I added the repository with the command :

$ wget https://repo.mysql.com//mysql-apt-config_0.8.12-1_all.deb

4) I installed the package with the command :

$ sudo dpkg -i mysql-apt-config_0.8.12-1_all.deb

enter image description here

My problem :

5) I install MySQL with the command :

$ sudo apt update
$ sudo apt install mysql-server

When I do step 5, it installs MySQL 5.7 why does not it install version 8 ?

enter image description here

ML19
  • 91
  • 1
  • 2
  • 8

2 Answers2

2

Well I attempted the above in a test machine, and it sure seems like something is broke in the mysql repository.

Specifically the key seems to be expired.

# apt-key list       
/etc/apt/trusted.gpg
--------------------
pub   dsa1024 2003-02-03 [SCA] [expired: 2019-02-17]
      A4A9 4068 76FC BD3C 4567  70C8 8C71 8D3B 5072 E1F5
uid           [ expired] MySQL Release Engineering <mysql-build@oss.oracle.com>

If you really want to ignore the errors and install you could adjust your mysql.list like below. Keeping in mind this does potentially open you to someone mitm the package download.

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb [trusted=yes] http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
deb [trusted=yes] http://repo.mysql.com/apt/ubuntu/ bionic mysql-8.0
deb [trusted=yes] http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
#deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools-preview
deb-src [trusted=yes] http://repo.mysql.com/apt/ubuntu/ bionic mysql-8.0

Anyway if you go this route, then you also need to know the packages seem to be named like mysql-community-* for the 8.0 packages from this repo.

# apt-cache policy mysql-community-server
mysql-community-server:
  Installed: (none)
  Candidate: 8.0.15-1ubuntu18.04
  Version table:
     8.0.15-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 Packages


# apt-cache policy mysql-community-server
mysql-community-server:
  Installed: (none)
  Candidate: 8.0.15-1ubuntu18.04
  Version table:
     8.0.15-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 Packages
root@01d5a926dd00:/etc/apt/sources.list.d# apt-cache show mysql-community-server
Package: mysql-community-server
Source: mysql-community
Version: 8.0.15-1ubuntu18.04
Architecture: amd64
Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
...
Provides: virtual-mysql-server
Homepage: http://www.mysql.com/
Priority: optional
Section: database
Filename: pool/mysql-8.0/m/mysql-community/mysql-community-server_8.0.15-1ubuntu18.04_amd64.deb
Description: MySQL Server
 The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
 and robust SQL (Structured Query Language) database server. MySQL Server
 is intended for mission-critical, heavy-load production systems as well
 as for embedding into mass-deployed software. MySQL is a trademark of
 Oracle. This package includes the MySQL server binary as well as related
 utilities to run and administer a MySQL server.
Zoredache
  • 130,897
  • 41
  • 276
  • 420
0

I had similar problem & solved by

sudo apt-get purge mysql\* libmysql\*

And followed this tutorial https://computingforgeeks.com/how-to-install-mysql-8-on-ubuntu/

Akashxolotl
  • 101
  • 1