无法卸载mysql损坏的mysql /安装新的mysql

时间:2019-07-12 11:52:52

标签: mysql

我对MySQL做了一些卑鄙的事情,我正面临着这个问题。

我正在尝试重新安装MySQL。使用sudo权限直接删除了MySQL文件夹,并尝试重新安装。

该修复程序将不胜感激

命令我正在运行

  

sudo apt-get install mysql-server

以下是我收到的输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-server is already the newest version (5.7.26-0ubuntu0.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 37 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.26-0ubuntu0.18.04.1) ...
/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)

1 个答案:

答案 0 :(得分:1)

https://askubuntu.com/a/1134184/653440

执行:sudo apt编辑源,并查找包含mariadb的任何内容,例如:deb [arch = amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu仿生学

在其前面加上#来注释它。然后运行

  

sudo apt更新

     

sudo apt清除mysql-common

     

sudo apt安装mysql-common

之后,您可以通过sudo apt install mysql-server正确安装mysql-server

帮助我解决了这个问题。