mysql-server-5.7 尚未配置

标签 mysql

我很久以前安装了 Mysql5.7,后来我卸载了它并安装了 MariaDB 禁用 apparmor (mysql) 配置文件。

现在我卸载了 MariaDB 并尝试安装 mysql5.7,但出现了这个错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version (5.7.28-0ubuntu0.18.04.4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up mysql-server-5.7 (5.7.28-0ubuntu0.18.04.4) ...
/var/lib/dpkg/info/mysql-server-5.7.postinst: line 191: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我也使用 sudo dpkg --configre -a 时出现此错误。

我使用 sudo apt install mysql-server 安装包。 我试着按照一些在线指南,我删除了 /var/lib/dpkg/info/mysql-server-5.7.postinst 清除了 mariadb、mysql 并尝试了很多东西。

最佳答案

好的,我是这样解决的:

  • 我使用 Software & Updates 应用程序删除了 mariadb 源
  • 执行了以下步骤(引用 https://askubuntu.com/a/934576):
  • sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server
  • sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install
  • sudo apt install mysql-server

关于mysql-server-5.7 尚未配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58961079/

相关文章:

mysql - Mongo - MySql 之间喜欢

mysql - 你如何从 mysql 中选择字符串中的最后一个字符 = x?

php - PHP/MYSQL 中的 ORDER BY 不起作用

mysql - 从每日数据中选择该月的平均值(每日总和/天数)

php - 如何在 MySQL/PHP 中滚动计数查询

mysql - 如何在 Laravel 5.4 中根据用户 ID 排除某些行?

MySQL使用IN()时的顺序

php - 如何维护聊天数据?

mysql - 清除 MYSQL 慢查询日志 - Rails

mysql - 无论如何,返回 IN 值的默认结果