gpt4 book ai didi

mysql - 我安装了 MariaDB,它搞砸了 Mysql,我也无法卸载

转载 作者:太空宇宙 更新时间:2023-11-04 09:16:33 25 4
gpt4 key购买 nike

所以,我最近一直在使用 Ubuntu,我一直在运行一些虚拟主机和一个 Terraria 服务器。我决定在我的一台虚拟服务器上安装 Clipbucket,我找到了这个指南:https://www.unixmen.com/install-clipbucket-ubuntu-15-10/ .

如指南所述,我安装了 MariaDB,没想到它会弄乱我的 MySQL。我的虚拟主机无法连接到 MySQL,我无法运行“mysql -u root -p”,因为出现错误“ERROR 2002 (HY000): 安装 MariaDB 后无法通过套接字 '/var/run/mysqld/mysqld.sock' (2)' 连接到本地 MySQL 服务器

我试图删除 MariaDB,但它给出了这个错误:

正在读取包列表...完成 构建依赖树 正在读取状态信息...完成 未安装软件包“mariadb-server”,因此未删除 您可能需要运行“apt --fix-broken install”来更正这些问题。 以下软件包具有未满足的依赖项: mysql-server :取决于:mysql-server-5.7 但不会安装 E:未满足的依赖项。尝试不带包的“apt --fix-broken install”(或 指定解决方案)。

我决定运行 apt --fix-broken install,我得到了这个:

Preconfiguring packages ...
(Reading database ... 92893 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.20-0ubuntu0.17.04.1_amd64.deb
...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
invoke-rc.d returned 5
There is a MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mysql-server-
5.7_5.7.20-0ubuntu0.17.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.7_5.7.20-0ubuntu0.17.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

现在,我想保留我的数据库,但我并不真的需要它们,我只是不想重新制作它们。一段时间以来,我一直在想办法做什么,但我真的很生气;/

编辑:我真的无法做任何事情,包括 apt-get install,因为它会告诉我它需要 mysql-server 的 mysql-5.7 并且它会失败。我刚刚重新格式化,显然一切正常,不,我的数据库没有工作,所以我也必须重新做这些。

最佳答案

我遇到了这个问题。我用过

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5

摆脱错误的 MySQL 安装。但显然仍有一些 mariadb 软件包阻止 MySQL 安装。检查使用

dpkg -l | grep '\(maria\|mysql\)'

此时应该没有 MySQL 包,但应该有一些 mariadb 包。在确认存在这些冲突包后,我使用

删除了它们
sudo apt-get purge mariadb*

然后我能够成功地重新安装 MySQL。

关于mysql - 我安装了 MariaDB,它搞砸了 Mysql,我也无法卸载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46985890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com