大网数据广告活动
服务器运维问答

How to upgrade to MySQL 8.0?

· 52CE 我爱测

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 : $…

问题原文

原帖链接 · ML19 · CC BY-SA 4.0

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

已采纳解答

原帖链接 · Zoredache · CC BY-SA 4.0

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 <[email omitted]>

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 <[email omitted]>
...
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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。