Linux rpm删除MySQL

来源:互联网 发布:淘宝改版 编辑:程序博客网 时间:2024/06/18 06:41

1、查找哪些已经被安装了:

my-linux: # rpm -qa |grep -i mysql
MySQL-client-5.6.23-1.sles11.x86_64
MySQL-server-5.6.23-1.sles11.x86_64
MySQL-shared-5.6.23-1.sles11.x86_64
MySQL-devel-5.6.23-1.sles11.x86_64

2、逐个卸载:

my-linux: # rpm -e --nodeps MySQL-client-5.6.23-1.sles11.x86_64
my-linux: # rpm -e --nodeps MySQL-server-5.6.23-1.sles11.x86_64
redirecting to systemctl stop mysql.service


Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.


If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.


mysql                     0:off  1:off  2:off  3:off  4:off  5:off  6:off

my-linux: # rpm -e --nodeps MySQL-shared-5.6.23-1.sles11.x86_64
my-linux: # rpm -e --nodeps MySQL-devel-5.6.23-1.sles11.x86_64

3、确认卸载结果:

my-linux: # rpm -qa |grep -i mysql
my-linux: # 


4、删除数据文件(假设目录为:mysql):

my-linux: # rm -rf mysql

0 0