CentOS下MySQL的彻底卸载

前端之家收集整理的这篇文章主要介绍了CentOS下MySQL的彻底卸载前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

转自:http://blog.csdn.net/typa01_kk/article/details/49057073


#################CentOS7下MySQL的卸载####################

1:查看MysqL是否安装:

方式1:

[plain] view plain copy
  1. [root@localhostusr]#yumlistinstalledMysqL*
  2. Loadedplugins:fastestmirror
  3. Loadingmirrorspeedsfromcachedhostfile
  4. *base:mirrors.yun-idc.com
  5. *extras:mirror.neu.edu.cn
  6. *updates:mirrors.yun-idc.com
  7. InstalledPackages
  8. MysqL-client.x86_645.6.27-1.el6installed
  9. MysqL-devel.x86_645.6.27-1.el6installed
  10. MysqL-server.x86_645.6.27-1.el6installed
  11. [root@localhostusr]#

方式2(-i :不区分大小写):

copy
    [root@localhostusr]#rpm-qa|grep-iMysqL
  1. MysqL-server-5.6.27-1.el6.x86_64
  2. MysqL-client-5.6.27-1.el6.x86_64
  3. MysqL-devel-5.6.27-1.el6.x86_64
  4. 2:卸载MysqL:

    卸载1:

    copy
    [root@localhostusr]#yumremoveMysqLMysqL-serverMysqL-libscompat-MysqL51
  1. [root@localhostusr]#rm-rf/var/lib/MysqL
  2. [root@localhostusr]#rm/etc/my.cnf

如果装了MysqL-devel(其他一样add command),卸载为:

copy
    [root@Tony_ts_tianinit.d]#yumremoveMysqLMysqL-develMysqL-serverMysqL-libscompat-MysqL51

注(例如):

MysqL-5.5.39-1.el6.remi.x86_64
MysqL-libs-5.5.39-1.el6.remi.x86_64
compat-MysqL51-5.1.54-1.el6.remi.x86_64
MysqL-server-5.5.39-1.el6.remi.x86_64
卸载2{继续,1,2选择一种(此处为介绍):}:
copy
    [root@localhostMysqL]#rpm-aq|grep-iMysqL
  1. [root@localhostMysqL]#rpm-eMysqL-server-5.6.27-1.el6.x86_64
  2. [root@localhostMysqL]#rpm-eMysqL-client-5.6.27-1.el6.x86_64
  3. [root@localhostMysqL]#rpm-eMysqL-devel-5.6.27-1.el6.x86_64
  4. [root@localhostrc.d]#cd/var/lib/
  5. [root@localhostlib]#rm-rfMysqL/
注:删除MysqL数据库目录(关键) ,否则password不更新(默认安装,如果自定义安装路径和链接路径ln -s ……请删除。)
rm -rf /var/lib/MysqL
卸载3:
[plain] view plain copy
  1. [root@localhostusr]#whereisMysqL
  2. MysqL:/usr/lib64/MysqL
  3. [root@localhostusr]#rm-rf/usr/lib64/MysqL
注:find / -name MysqL (rm -rf 相关的的目录)
注:清空相关MysqL的所有目录以及文件和其他配置和设置等。如果有,则删除。也必须考虑其他软件不去影响。
rm -rf /usr/lib/MysqL
rm -rf /usr/share/MysqL
卸载4
copy
    [root@localhostusr]#rm–rf/usr/my.cnf
  1. [root@localhostusr]#rm-rf/root/.MysqL_sercret
卸载5(自启服务):
copy
    [root@localhostusr]#chkconfig--list|grep-iMysqL
  1. [root@localhostusr]#chkconfig--delMysqLd
copy
    此处删除看自己设置:MysqL/MysqLd
原文链接:https://www.f2er.com/centos/379426.html

猜你在找的CentOS相关文章