ubuntu下安裝mysql 報錯

apt-get install mysql-server 時候報錯如下:

    

Preconfiguring packages ...

Setting up mysql-common (5.7.13-0ubuntu0.16.04.2) ...

update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist

dpkg: error processing package mysql-common (--configure):

 subprocess installed post-installation script returned error exit status 2

Errors were encountered while processing:

 mysql-common

E: Sub-process /usr/bin/dpkg returned an error code (1)



網上找到差不多的錯誤,於是決定嘗試下。good luck for me !! ok 了 

解決辦法:

    

刪除mysql前 先刪除一下 /var/lib/mysql 還有 /etc/mysql



sudo rm /var/lib/mysql/ -R

sudo rm /etc/mysql/ -R


sudo apt-get autoremove mysql* --purge

sudo apt-get remove apparmor


sudo apt-get install mysql-server mysql-common

感謝這位博主:

    原文地址:http://blog.sina.com.cn/s/blog_417ad82e0101el5i.html    

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章