CentOS下MySQL的彻底卸载

原创
2015年10月12日 00:16:02
  • 标签:
  • 			</ul>
    <ul class="right_bar">
    <li><button class="btn-noborder"><i class="icon iconfont icon-read"></i><span class="txt">21149</span></button></li>
    <!--<li><button class="btn-noborder"><i class="icon iconfont icon-dashang-"></i><span class="txt">0</span></button></li>--> <li class="edit" style="display: none;">
    <a class="btn-noborder" href="http://write.blog.csdn.net/postedit/49057073">
    <i class="icon iconfont icon-bianji"></i><span class="txt">编辑</span>
    </a>
    </li>
    <li class="del" style="display: none;">
    <a class="btn-noborder" onclick="javascript:deleteArticle(fileName);return false;">
    <i class="icon iconfont icon-shanchu"></i><span class="txt">删除</span>
    </a>
    </li>
    </ul>
    </div>
    <div id="article_content" class="article_content csdn-tracking-statistics" data-mod="popu_307" data-dsm="post">

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

    1:查看MySQL是否安装:

    方式1:

    1. [root@localhost usr]# yum list installed mysql*
    2. Loaded plugins: fastestmirror
    3. Loading mirror speeds from cached hostfile
    4. * base: mirrors.yun-idc.com
    5. * extras: mirror.neu.edu.cn
    6. * updates: mirrors.yun-idc.com
    7. Installed Packages
    8. MySQL-client.x86_64   5.6.27-1.el6    installed
    9. MySQL-devel.x86_64    5.6.27-1.el6    installed
    10. MySQL-server.x86_64   5.6.27-1.el6    installed
    11. [root@localhost usr]#
    [root@localhost usr]# yum list installed mysql*
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.yun-idc.com
    * extras: mirror.neu.edu.cn
    * updates: mirrors.yun-idc.com
    Installed Packages
    MySQL-client.x86_64 5.6.27-1.el6 installed
    MySQL-devel.x86_64 5.6.27-1.el6 installed
    MySQL-server.x86_64 5.6.27-1.el6 installed
    [root@localhost usr]#

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

    1. [root@localhost usr]# rpm -qa | grep -i mysql
    2. MySQL-server-5.6.27-1.el6.x86_64
    3. MySQL-client-5.6.27-1.el6.x86_64
    4. MySQL-devel-5.6.27-1.el6.x86_64
    5. [root@localhost usr]#
    [root@localhost usr]# rpm -qa | grep -i mysql
    MySQL-server-5.6.27-1.el6.x86_64
    MySQL-client-5.6.27-1.el6.x86_64
    MySQL-devel-5.6.27-1.el6.x86_64
    [root@localhost usr]#

    2:卸载MySQL:

    卸载1:

    1. [root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51
    2. [root@localhost usr]# rm -rf /var/lib/mysql
    3. [root@localhost usr]# rm /etc/my.cnf
    [root@localhost usr]# yum remove mysql mysql-server mysql-libs compat-mysql51
    [root@localhost usr]# rm -rf /var/lib/mysql
    [root@localhost usr]# rm /etc/my.cnf

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

    1. [root@Tony_ts_tian init.d]# yum remove mysql mysql-devel mysql-server mysql-libs compat-mysql51
    [root@Tony_ts_tian init.d]# yum remove mysql mysql-devel mysql-server mysql-libs compat-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选择一种(此处为介绍):}:
    1. [root@localhost mysql]# rpm -aq | grep -i mysql
    2. MySQL-server-5.6.27-1.el6.x86_64
    3. MySQL-client-5.6.27-1.el6.x86_64
    4. MySQL-devel-5.6.27-1.el6.x86_64
    5. [root@localhost mysql]# rpm -e MySQL-server-5.6.27-1.el6.x86_64
    6. [root@localhost mysql]# rpm -e MySQL-client-5.6.27-1.el6.x86_64
    7. [root@localhost mysql]# rpm -e MySQL-devel-5.6.27-1.el6.x86_64
    8. [root@localhost rc.d]# cd /var/lib/
    9. [root@localhost lib]# rm -rf mysql/
    [root@localhost mysql]# rpm -aq | grep -i mysql
    MySQL-server-5.6.27-1.el6.x86_64
    MySQL-client-5.6.27-1.el6.x86_64
    MySQL-devel-5.6.27-1.el6.x86_64
    [root@localhost mysql]# rpm -e MySQL-server-5.6.27-1.el6.x86_64
    [root@localhost mysql]# rpm -e MySQL-client-5.6.27-1.el6.x86_64
    [root@localhost mysql]# rpm -e MySQL-devel-5.6.27-1.el6.x86_64
    [root@localhost rc.d]# cd /var/lib/
    [root@localhost lib]# rm -rf mysql/
    注:删除MySQL数据库目录(关键) ,否则password不更新(默认安装,如果自定义安装路径和链接路径ln -s ……请删除。)
      rm -rf /var/lib/mysql
    卸载3:
    1. [root@localhost usr]# whereis mysql
    2. mysql: /usr/lib64/mysql
    3. [root@localhost usr]# rm -rf /usr/lib64/mysql
    [root@localhost usr]# whereis mysql
    mysql: /usr/lib64/mysql
    [root@localhost usr]# rm -rf /usr/lib64/mysql
    注:find / -name mysql
    注:清空相关mysql的所有目录以及文件和其他配置和设置等。如果有,则删除。也必须考虑其他软件不去影响。
    rm -rf /usr/lib/mysql

    rm -rf /usr/share/mysql

    卸载4:
    1. [root@localhost usr]# rm –rf /usr/my.cnf
    2. [root@localhost usr]# rm -rf /root/.mysql_sercret
    [root@localhost usr]# rm –rf /usr/my.cnf
    [root@localhost usr]# rm -rf /root/.mysql_sercret
    卸载5(自启服务):
    1. [root@localhost usr]# chkconfig --list | grep -i mysql
    2. [root@localhost usr]# chkconfig --del mysqld
    [root@localhost usr]# chkconfig --list | grep -i mysql
    [root@localhost usr]# chkconfig --del mysqld
    1. 此处删除看自己设置:mysql/mysqld
    此处删除看自己设置:mysql/mysqld 

五、Centos7安装mysql:第一步查看系统有无mysql,然后删除之的更多相关文章

  1. CentOS7安装CDH 第一章:CentOS7系统安装

    相关文章链接 CentOS7安装CDH 第一章:CentOS7系统安装 CentOS7安装CDH 第二章:CentOS7各个软件安装和启动 CentOS7安装CDH 第三章:CDH中的问题和解决方法 ...

  2. configure - 源代码安装的第一步

    configure是源代码安装的第一步,主要的作用是对即将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系 configure有许多参数可配,具体参见./configure --help ...

  3. 配置环境是程序员的第一步 -- Windows 10 下 MySQL 安装

    MySQL 作为最典型的关系型数据库管理系统,由于其体积小.速度快.总体拥有成本低,尤其是其开放源码这一特点,一般中小型网站的开发都选择 MySQL 作为网站数据库.MySQL 社区版的功能也足够我们 ...

  4. PHP在Windows下安装配置第一步

    第一步就是下载和安装PHP解释器了: 1.下载Windows版本号的PHP解释器,下载地址:官方下载 我下载的是 VC11 x64 Thread Safe 这个以下的zip包 2.下载完毕后,解压到 ...

  5. [CentOS 7] 安装nginx第一步先搭建nginx服务器环境

    简要地介绍一下,如何在CentOS 7中安装nginx服务器 方法/步骤   下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/ ...

  6. CentOS7安装Memcached 三步曲

    1.yum 安装 yum clean allyum -y updateyum -y install memcached 2.Memcached 运行 memcached -h //查看考号修改配置vi ...

  7. mysql 第一课 win7艰难的配置与删除注册表重新安装

    mysql 这个安装一定要慎重!慎重!慎重! 重要的事情说三遍.. 不会的一定要按步骤来~出错了真的很难受. 详细教程 -->  https://jingyan.baidu.com/album/ ...

  8. CentOS7安装CDH 第五章:CDH的安装和部署-CDH5.7.0

    相关文章链接 CentOS7安装CDH 第一章:CentOS7系统安装 CentOS7安装CDH 第二章:CentOS7各个软件安装和启动 CentOS7安装CDH 第三章:CDH中的问题和解决方法 ...

  9. Linux系统下 MySQL 安装 指南(5.7和8.0 版本)

    一. 准备工作 1 删除本地centos7中的mariadb: 查看系统中是否已安装 mariadb 服务: rpm -qa | grep mariadb 或 yum list installed | ...

随机推荐

  1. wampserver3.0.6 外网 不能访问

    # 开始 今天在服务器上安装了wampserver3.0.6 然后在我的电脑浏览器上面打开服务器ip提示 Forbidden 下面一行小字提示没有权限访问"/"目录 # 解决 打开 ...

  2. JavaScript 实现单例模式的两种方式

    单例模式: 要求一个类只有一个实例化对象存在 这个实例化对象必须提供一个全局对外访问方式 这个实例化对象应当是私有的,不能被外界直接访问或者更改 方式1 get实现 唯一实例化:判断这个对象是否存在, ...

  3. SPAN, RSPAN, ERSPAN

    该文档摘自:Home > CCIE Routing and Switching Study Group > Discussions 由 Deben 于 2015-2-6 上午6:50 创建 ...

  4. Centos 7源码编译安装 php7.1 之生产篇

    Centos 7源码编译安装 php7.1 之生产篇 Published 2017年4月30日 by Node Cloud 介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具 ...

  5. 获取input type=radio属性的value值

    个人代码1: <div class="form-group" style="width: 250px;margin:0 auto;"> <la ...

  6. 浏览器 User-Agent 整理

    也可以去这里查询:http://tools.jb51.net/table/useragent window.navigator.userAgent 1) Chrome Win7: Mozilla/5. ...

  7. cf--TV Subscriptions (Hard Version)

    time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standa ...

  8. BUG搬运工:CSCun88303-CIMC Memory Leak : Can't SSH/HTTP to CIMC

    Symptom:Unable to SSH/HTTP to the CIMC of the C-series server, however the CIMC can be pinged. Also ...

  9. Nexus-FEX基础配置

    1.FEX基本配置feature fex fex 100  pinning max-links 1  >>>>该值默认就是1  description "FEX100 ...

  10. 【原】mac电脑常用快捷建

    wiki:http://www.wjjsoft.com/mybase_cn.html 1.终端 有时一个终端并不够,如何快速打开多个呢,在上部打开之伤的基础下,直接按快捷键command+N即可 一个 ...