ubuntu 用apt-get安装mysql-server时报错的处理方法

By | 2018-11-27

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)

解决办法:

 

删除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


發佈回覆