【问题标题】:MySQL Installation problem in wsl2 ubuntu 22.04wsl2 ubuntu 22.04中的MySQL安装问题
【发布时间】:2022-08-16 00:41:16
【问题描述】:

我在 Windows 10 专业版中使用 wsl2。我尝试了很多来安装 mysql,但我每次都遇到这个错误。 我尝试使用以下命令再次卸载并安装:

    sudo service mysql stop
    sudo apt purge mysql-server mysql-client mysql-common
    sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
    sudo apt autoremove
    sudo apt autoclean

并再次安装它。

我得到了这个错误

Unpacking mysql-server (8.0.29-0ubuntu0.22.04.3) ...
Setting up mysql-client-8.0 (8.0.29-0ubuntu0.22.04.3) ...
Setting up mysql-server-8.0 (8.0.29-0ubuntu0.22.04.3) ...
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                        [ OK ]
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 4602
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                                   dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

    标签: mysql wsl-2 ubuntu-22.04


    【解决方案1】:

    按照 Microsoft 文档中的说明进行操作: https://docs.microsoft.com/en-us/windows/wsl/tutorials/wsl-database

    【讨论】:

      猜你喜欢
      • 2022-11-16
      • 2022-08-11
      • 2022-07-01
      • 2022-08-14
      • 2023-01-11
      • 2022-06-14
      • 2021-03-16
      • 2022-11-11
      • 2022-07-06
      相关资源
      最近更新 更多