在Ubuntu或Debian系统的服务器上卸载MySQL的方法

所属分类: 数据库 / Mysql 阅读数: 1456
收藏 0 赞 0 分享

对于有的vps,系统默认安装了mysql。我们需要从我们的服务器、vps上卸载(移除)默认的mysql。那么如何(怎样)在ubuntu\Debian上卸载mysql?

通常情况下,下列mysql软件包会被安装到 Debian 、Ubuntu中:

  • mysql-client - The latest version of MySQL database client(最新版的mysql数据库客户端).
  • mysql-server - The latest version of MySQL database server.(最新版的mysql数据库服务端)
  • mysql-common - MySQL database common files(mysql数据库命令文件)

那么如何怎样在ubuntu\Debian上卸载mysql?
只需要使用 apt-get 命令 即可,如下面的命令,同时卸载 ubuntu \ Debian 中的 mysql server 和 mysql client :

sudo apt-get --purge remove mysql-client mysql-server mysql-common
sudo apt-get autoremove

解释: --purge 移除所给的软件包和配置文件

remove 表示卸载软件包

autoremove 表示自动卸载软件包,以及与该软件包的依赖(软件包)

输入如下(注意软件包名字):

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
 linux-headers-3.2.0-31-virtual linux-headers-3.2.0-31
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
 libdbd-mysql-perl* libmysqlclient18* mysql-client* mysql-client-5.5* mysql-common* mysql-server*
 mysql-server-5.5*
0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.
After this operation, 67.5 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 105097 files and directories currently installed.)
Removing mysql-server ...
Removing mysql-server-5.5 ...
mysql stop/waiting
Purging configuration files for mysql-server-5.5 ...
Removing mysql-client ...
Removing mysql-client-5.5 ...
Removing libdbd-mysql-perl ...
Removing libmysqlclient18 ...
Purging configuration files for libmysqlclient18 ...
Removing mysql-common ...
Purging configuration files for mysql-common ...
dpkg: warning: while removing mysql-common, directory '/etc/mysql' not empty so not removed.
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

删除 /etc/mysql 目录,使用如下命令:

sudo rm -rf /etc/mysql/  

解释:-r 同时删除该目录下的所有子目录。 -f 表示强制删除

更多精彩内容其他人还在看

MySQL优化之表结构优化的5大建议(数据类型选择讲的很好)

很多人都将 数据库设计范式 作为数据库表结构设计“圣经”,认为只要按照这个范式需求设计,就能让设计出来的表结构足够优化,既能保证性能优异同时还能满足扩展性要求
收藏 0 赞 0 分享

MySQL的表分区详解

这篇文章主要介绍了MySQL的表分区,例如什么是表分区、为什么要对表进行分区、表分区的4种类型详解等,需要的朋友可以参考下
收藏 0 赞 0 分享

MySQL基本命令、常用命令总结

这篇文章主要介绍了MySQL基本命令、常用命令总结,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql 强大的trim() 函数

这篇文章主要介绍了mysql 强大的trim() 函数使用方法,需要的朋友可以参考下
收藏 0 赞 0 分享

MySQL函数大全及用法示例分享

这篇文章主要介绍了MySQL的一些函数及用法示例,需要的朋友可以参考下
收藏 0 赞 0 分享

MySQL不支持INTERSECT和MINUS及其替代方法

这篇文章主要介绍了MySQL不支持INTERSECT和MINUS情况下的替代方法,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql修改数据库编码(数据库字符集)和表的字符编码的方法

Mysql数据库是一个开源的数据库,应用非常广泛。以下是修改mysql数据库的字符编码的操作过程和将表的字符编码转换成utf-8的方法,需要的朋友可以参考下
收藏 0 赞 0 分享

mysql远程登录出错的解决方法

mysql远程登录出错的情况,先比很多朋友都有遇到过吧,下面有个不错的解决方法,大家可以参考下
收藏 0 赞 0 分享

mysql通过查看跟踪日志跟踪执行的sql语句

在SQL SERVER下跟踪sql采用事件探查器,而在mysql下如何跟踪sql呢,下面有个不错的方法,大家可以参考下
收藏 0 赞 0 分享

MySQL错误代码大全

本章列出了当你用任何主机语言调用MySQL时可能出现的错误。首先列出了服务器错误消息。其次列出了客户端程序消息
收藏 0 赞 0 分享
查看更多