![如何从 Ubuntu 14.04 中删除 MySQL Server 5.5?](https://linux22.com/image/882775/%E5%A6%82%E4%BD%95%E4%BB%8E%20Ubuntu%2014.04%20%E4%B8%AD%E5%88%A0%E9%99%A4%20MySQL%20Server%205.5%EF%BC%9F.png)
我想将我的 MySQL 服务器和客户端升级v5.5.49
到最新版本v5.6.*
。为此,我首先尝试卸载旧版本:
$ apt-get remove mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5
--purge
为了保留当前设置,我没有使用该参数。
但无法mysql-server-5.5
卸载:
$ dpkg --get-selections | grep mysql
libdbd-mysql-perl install
libmysqlclient18:amd64 install
mysql-common install
mysql-server-5.5 deinstall
php7.0-mysql install
但是,我安装了新版本:
$ apt-get install mysql-client-5.6 mysql-client-core-5.6
$ apt-get install mysql-server-5.6 mysql-server-core-5.6
现在安装了两个 MySQL Server 版本:
$ dpkg --get-selections | grep mysql
libdbd-mysql-perl install
libmysqlclient18:amd64 install
mysql-client-5.6 install
mysql-client-core-5.6 install
mysql-common install
mysql-server-5.5 deinstall
mysql-server-5.6 install
mysql-server-core-5.6 install
php7.0-mysql install
但较新的版本正在使用中:
mysql> SELECT VERSION();
+-------------------------+
| VERSION() |
+-------------------------+
| 5.6.30-0ubuntu0.14.04.1 |
+-------------------------+
1 row in set (0.00 sec)
无论如何,虽然升级本身成功了,但我想再次清理我的系统并卸载旧版本。
如何卸载旧版 MySQL 服务器(无需删除配置)?是否可以通过apt
包管理器 ( apt-get
/ aptitude
) 执行此操作?
更新
回答 fkraiem 的评论:
$ dpkg -l | grep mysql
ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient18:amd64 5.5.49-0ubuntu0.14.04.1 amd64 MySQL database client library
ii mysql-client-5.6 5.6.30-0ubuntu0.14.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.6 5.6.30-0ubuntu0.14.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.7.12-1~exp1+deb.sury.org~trusty+1 all MySQL database common files, e.g. /etc/mysql/my.cnf
rc mysql-server-5.5 5.5.49-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-5.6 5.6.30-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.6 5.6.30-0ubuntu0.14.04.1 amd64 MySQL database server binaries
ii php7.0-mysql 7.0.3-4+deb.sury.org~trusty+1 amd64 MySQL module for PHP
答案1
rc mysql-server-5.5
表示软件包已卸载 ( r
),但一些配置文件仍保留 ( c
)(以防您以后想再次安装)。要删除它们(并使软件包完全消失dpkg -l
),请使用sudo apt-get purge mysql-server-5.5
。