如何在Ubuntu 20.04上安装Mysql 5.7.30

如何在Ubuntu 20.04上安装Mysql 5.7.30

我正在 Ubuntu 20.04 上安装 MySQL 5.7.30。当我跑步时:

sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb

这是输出:

(Reading database ... 74194 files and directories currently installed.)
Preparing to unpack mysql-apt-config_0.8.16-1_all.deb ...
Unpacking mysql-apt-config (0.8.16-1) over (0.8.16-1) ...
Setting up mysql-apt-config (0.8.16-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK

任何人都可以解释如何避免此警告及其含义吗?我现在很困惑。

答案1

mysql存储库中的版本mysql从 升级到5.7.30。它可以从存储库5.7.33安装。focalbionic

您可以使用它sudo dpkg-reconfigure mysql-apt-config来设置存储库。

您也可以手动编辑您的内容,/etc/apt/sources.list.d/mysql.list如下所示:

deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools-preview
deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7

如果你还没有添加 gpg key ,你可以查看官方文档来验证并添加 mysql gpg : 2.1.4.2 使用 GnuPG 检查签名

为了防止mysql-apt-config覆盖mysql.list, it can be removed.

然后运行:

sudo apt update
apt policy mysql-server

示例输出:

mysql-server:
  Installed: (none)
  Candidate: 8.0.22-0ubuntu0.20.04.3
  Version table:
     8.0.22-0ubuntu0.20.04.3 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     8.0.19-0ubuntu5 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
     5.7.33-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages

要安装它,请运行:

sudo apt install mysql-community-client=5.7.33-1ubuntu18.04
sudo apt install mysql-client=5.7.33-1ubuntu18.04
sudo apt install mysql-server=5.7.33-1ubuntu18.04

相关内容