簡體   English   中英

我安裝了 MariaDB,但它搞砸了 Mysql,我也無法卸載

[英]I installed MariaDB and it messed up Mysql and I can't uninstall either

所以,我最近一直在玩 Ubuntu,我一直在運行一些虛擬主機和一個泰拉瑞亞服務器。 我決定在我的一台虛擬服務器上安裝 Clipbucket,我找到了這個指南: https ://www.unixmen.com/install-clipbucket-ubuntu-15-10/。

正如指南所說,我安裝了 MariaDB,沒想到它會弄亂我的 MySQL。 我的虛擬主機無法連接到 MySQL,我無法運行 'mysql -u root -p' 因為我收到錯誤 ' ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run安裝MariaDB后的/mysqld/mysqld.sock'(2)'

我試圖刪除 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。

在終端輸入: sudo dpkg --reconfigure -asudo apt-get install -f

您可以完全卸載mysql / mariadb如下:

apt-get purge mariadb-server mariadb-* mysql-*

記住:清除就像在說 [ 也卸載並刪除配置文件 ]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM