在 Ubuntu 16.04 上安装 MySQL 8 时出现意外错误

在 Ubuntu 16.04 上安装 MySQL 8 时出现意外错误

我想在 Ubuntu-16.04 上安装 MySQL-8,我正在遵循官方文档。我以前没有在这个服务器上安装过 MySQL,所以这是第一次安装 MySQL。

首先,我已经下载了 mysql-apt-config,使用wget方法如下:

root@test-server:~# wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb

然后,我使用更新了存储库sudo apt-get update,然后使用配置了 mysql-community-serverdpkg -i mysql-apt-config_0.8.10-1_all.deb并选择了我想要安装的版本(mysql-8)。

然后我尝试使用apt如下方法安装 MySQL 服务器:

root@test-server:~# sudo apt-get install mysql-server -y

它要求我输入 root 密码,我输入了密码,但是它显示以下错误。

.
.
Setting up mysql-community-server-core (8.0.11-1ubuntu17.10) ...
Setting up mysql-community-server (8.0.11-1ubuntu17.10) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
dpkg: error processing package mysql-community-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-community-server (= 8.0.11-1ubuntu17.10); however:
  Package mysql-community-server is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.26-0ubuntu2.1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (234-2ubuntu12.3) ...
Processing triggers for ureadahead (0.100.0-20) ...
Errors were encountered while processing:
 mysql-community-server
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

它说mysql-community-server没有配置,但我之前已经配置过了。我尝试多次重新安装操作系统,也尝试使用不同的方法安装 MySQL 8,但每次都出现相同的错误。

相关内容