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
感谢这位博主: