1. 删除mysql
a. sudo apt-get autoremove --purge mysql-server-5.0b. sudo apt-get remove mysql-serverc. sudo apt-get autoremove mysql-serverd. sudo apt-get remove mysql-common (非常重要)2. 清理残留数据dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P如果报如下错误,证明你的系统中没有残留配置文件了,无须担心。
dpkg: --purge needs at least one package name argument
Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;Type dpkg -Dhelp for a list of dpkg debug flag values;Type dpkg --force-help for a list of forcing options;Type dpkg-deb --help for help about manipulating *.deb files;Type dpkg --license for copyright license and lack of warranty (GNU GPL) [*].Options marked [*] produce a lot of output - pipe it through `less' or `more' !
下面安装mysql5.6你必须先删除这些文件夹:/etc/mysql/ /var/lib/mysql /var/log/mysql/var/lib/mysql-filters /var/lib/mysql-keyring和这个文件:/var/lib/mysql/debian-5.7.flag - T0m3kk 7月22日在12:41 1. sudo apt-get install software-properties-common 2. $ sudo add-apt-repository -y ppa:ondrej/mysql-5.6 3. $ sudo apt-get update 4. $ sudo apt-get install mysql-server-5.6