Linux下卸载MySQL

本文详细介绍了如何彻底卸载MySQL数据库,包括停止服务、删除RPM包安装的组件、移除服务配置、清理文件夹及配置文件等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


1、首先关闭或杀掉mysql进程


2、查看系统中是否有以rpm包安装的mysql
    1)[root@host01 local]# rpm -qa | grep -i mysql
    2)如果有,用 rpm -e 命令删除包

3、查看是否有mysql的服务
    1)[root@host01 local]# chkconfig --list | grep -i mysql
    2)如果有,删除mysql服务
         [root@host01 local]# chkconfig --del mysql

4、查看mysql文件夹
    1)[root@host01 local]# whereis mysql
    2)用 rm -fr 命令删除文件夹

5、删除配置文件
     [root@host01 local]# rm -fr /etc/my.cnf

--删除过程
[root@host01 etc]# /etc/init.d/mysql stop
Shutting down MySQL....                                    [  OK  ]

[root@host01 etc]# rpm -qa | grep -i mysql
MySQL-devel-community-5.1.68-1.rhel5
MySQL-server-community-5.1.68-1.rhel5
MySQL-client-community-5.1.68-1.rhel5
[root@host01 etc]# rpm -e MySQL-devel-community-5.1.68-1.rhel5
[root@host01 etc]# rpm -e MySQL-server-community-5.1.68-1.rhel5
[root@host01 etc]# rpm -e MySQL-client-community-5.1.68-1.rhel5

[root@host01 etc]# chkconfig --list | grep -i mysql
[root@host01 etc]#

[root@host01 etc]# whereis mysql
mysql: /usr/lib/mysql
[root@host01 etc]# rm -fr /usr/lib/mysql
[root@host01 local]# rm -fr /etc/my.cnf

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27633655/viewspace-1092348/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/27633655/viewspace-1092348/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值