新聞中心
新搭建的服務(wù)器,先在ubuntu上安裝mariadb,后來(lái)由于很多權(quán)限問(wèn)題,決定安裝mysql,由于在卸載過(guò)程中未卸載干凈,導(dǎo)致MySQL重新安裝過(guò)程中出現(xiàn)了很多問(wèn)題。

10年積累的網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先做網(wǎng)站后付款的網(wǎng)站建設(shè)流程,更有北湖免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
Reading package lists...Done
Building dependency tree
Reading state information ... Done
mysql-server is already the newest version(5.7.21-0ubuntu0.16.04.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server: depends: mysql-server-5.7 but it is not going to be installed
E: Unmet dependencies.Try 'apt-get -f install' with no packages(or specify a solution).
通過(guò)閱讀錯(cuò)誤信息可知,主要是因?yàn)橐蕾囮P(guān)系出現(xiàn)問(wèn)題,主要思路是重建依賴關(guān)系,然后干凈卸載,最后重裝。
首先,更新系統(tǒng)
sudo apt-get update
然后,修復(fù)安裝錯(cuò)誤,會(huì)提示輸入mysql用戶名密碼
sudo apt-get --fix-broken install
然后,檢索mysql安裝包,并刪除檢索出的依賴包,然后是刪除/var/lib/mysql,最后重裝mysql。
下面我把檢索到的解決方法展示給大家:
We excute the following commands to solve the above problem:
1.Get the list of MySQL packages installed on the system by executing the command sudo dpkg -l grep mysql
2.Remove the packages shown above by executing the command
sudo apt-get --purge autoremove
3. Delete /var/lib/mysql
4.Try to install mysql again.It should solve your problem.
第二步中的packages如下圖所示:
最后就是更新系統(tǒng)并重裝mysql
sudo apt-get update
sudo apt-get install mysql-server mysql-client
總結(jié):
整體思路還是重建依賴關(guān)系,干凈卸載,更新安裝。希望對(duì)遇到相同問(wèn)題不知所措的小伙伴有所啟發(fā)、幫助。謝謝。
分享標(biāo)題:Ubuntu重新安裝MySQL錯(cuò)誤解決
URL分享:http://m.fisionsoft.com.cn/article/dhoejgp.html


咨詢
建站咨詢
