MySQL 8 安装失败 - dpkg:依赖性问题阻止配置 mysql-server:

MySQL 8 安装失败 - dpkg:依赖性问题阻止配置 mysql-server:

我还无法在 Ubuntu 中安装 MySQL 8。

  • 发行版:Ubuntu 18.04.2 LTS(使用 WSL 在 Windows 上运行)
  • WSL 版本:4.4.0-17134-Microsoft
  • Mysql服务器:8.0.16-2ubuntu18.04 amd64

我正在遵循以下说明 -全新安装 MySQL 的步骤

下载的 Deb 包:(mysql-apt-config_0.8.13-1_all.deb)

我尝试了在互联网上找到的一些基于类似案例的建议,但都没有奏效。示例:sudo apt -f install-> 为了修复依赖性问题。

安装完成后,我运行命令启动mysql服务器,但是服务无法识别,因此安装失败。

根据我的经验,很难准确评估问题的根本原因,任何建议和建议都将非常感谢。

我计划按照此过程安装 My SQL Community Server,https://dev.mysql.com/downloads/mysql/,在这里我可以选择要安装的软件包。


安装过程完成后,已安装 MySql 包

dpkg -l | grep mysql -> Installed Packages

ii  mysql-apt-config               0.8.13-1                           all          Auto configuration for MySQL APT Repo.
ii  mysql-client                   8.0.16-2ubuntu18.04                amd64        MySQL Client meta package depending on latest version
ii  mysql-common                   8.0.16-2ubuntu18.04                amd64        Common files shared between packages
ii  mysql-community-client         8.0.16-2ubuntu18.04                amd64        MySQL Client
ii  mysql-community-client-core    8.0.16-2ubuntu18.04                amd64        MySQL Client Core Binaries
iF  mysql-community-server         8.0.16-2ubuntu18.04                amd64        MySQL Server
ii  mysql-community-server-core    8.0.16-2ubuntu18.04                amd64        MySQL Server Core Binaires
iU  mysql-server                   8.0.16-2ubuntu18.04                amd64        MySQL Server meta package depending on latest version

安装输出:

update-alternatives: using /var/lib/mecab/dic/ipadic to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-client (8.0.16-2ubuntu18.04) ...
Setting up mysql-community-server-core (8.0.16-2ubuntu18.04) ...
Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-1) ...
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27327
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix      : 100% |###########################################|

done!
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-community-server (8.0.16-2ubuntu18.04) ...
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):
 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.16-2ubuntu18.04); 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.27-3ubuntu1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:E: Sub-process /usr/bin/dpkg returned an error code (1)

谨致问候,里卡多

我按照另一个问题的建议操作,但没有效果,但我同意这个问题是重复的。

答案1

我发现了一个有用的链接:https://github.com/Microsoft/WSL/issues/3631,@jw-redpanda 帮我解决了一些问题。他提到了在 Windows 中使用 WSL 安装 MySql 8.0 时遇到的问题。MySQl 无法启动。他提出了一种解决方法,对我来说,至少我可以安装版本 5.7,但在第 5 步之后,当您有版本 8 作为候选时,我无法继续。它对其他人有效,所以祝你好运。

答案2

在 WSL 2(我假设是 WSL 1)下,systemd 默认不可用,并且 init.d 脚本不会在启动时运行。

此外,如果你从此处的 deb 包安装 MySQL 8https://dev.mysql.com/downloads/repo/apt/用于启动或停止 MySQL 的默认 mysql.server 帮助脚本将不会被安装。

一个解决方案是从这里下载 mysql.server.sh 脚本 -https://github.com/mysql/mysql-server/tree/8.0/support-files然后将脚本复制并重命名为 /etc/init.d/mysql(确保它也是可执行的 - chmod +x mysql)

然后您需要设置 basdir、datadir 和 pid 文件位置的默认值。

以下是完整的文章以及一些其他提示...https://www.58bits.com/blog/2020/05/03/installing-mysql-80-under-wsl-2-and-ubuntu

相关内容