CentOS下如何完全卸载MySQL?解决卸载不干净的问题

系统:CentOS 6.5,MySQL:MySql 5.6

这里主要解决使用rpm安装的卸载问题,安装方法见:CentOS安装mysql*.rpm提示conflicts with file from package的解决办法

虽然说这里的是使用rpm安装的卸载问题,我觉得使用yum方式安装的如果遇到相同的问题也一样适用。

查看已经安装的服务

rpm –qa|grep -i mysql

-i 作用是不区分大小写

可以看到有两个安装包

MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm

删除这两个服务(去掉后缀)

rpm –e MySQL-client-5.6.19-1.linux_glibc2.5.x86_64
rpm -e MySQL-server-5.6.19-1.linux_glibc2.5.x86_64

查看残留的目录:

whereis mysql

然后删除mysql目录:

rm –rf /usr/lib64/mysql

删除相关文件:

rm –rf /usr/my.cnf
rm -rf /root/.mysql_sercret

最关键的:

rm -rf /var/lib/mysql

如果这个目录如果不删除,再重新安装之后,密码还是之前的密码,不会重新初始化!

网上查了很久都没有文章提到这个,最后还是自己摸索找出来的。

卸载完成!怎么确定是不是真的卸载干净了呢?

一是看安装输出:

如果没有卸载干净,安装server时输入只有两行:

[plain]  view plain copy
  1. [root@localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
  2. Preparing...                ########################################### [100%]
  3. 1:MySQL-server           ########################################### [100%]

卸载干净了安装输入如下:

[plain]  view plain copy
  1. [root@localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
  2. Preparing...                ########################################### [100%]
  3. 1:MySQL-server           ########################################### [100%]
  4. 2014-09-23 07:22:43 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  5. 2014-09-23 07:22:43 26041 [Note] InnoDB: Using atomics to ref count buffer pool pages
  6. 2014-09-23 07:22:43 26041 [Note] InnoDB: The InnoDB memory heap is disabled
  7. 2014-09-23 07:22:43 26041 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  8. 2014-09-23 07:22:43 26041 [Note] InnoDB: Compressed tables use zlib 1.2.3
  9. 2014-09-23 07:22:43 26041 [Note] InnoDB: Using Linux native AIO
  10. 2014-09-23 07:22:43 26041 [Note] InnoDB: Using CPU crc32 instructions
  11. 2014-09-23 07:22:43 26041 [Note] InnoDB: Initializing buffer pool, size = 128.0M
  12. 2014-09-23 07:22:43 26041 [Note] InnoDB: Completed initialization of buffer pool
  13. 2014-09-23 07:22:43 26041 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
  14. 2014-09-23 07:22:43 26041 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
  15. 2014-09-23 07:22:43 26041 [Note] InnoDB: Database physically writes the file full: wait...
  16. 2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
  17. 2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
  18. 2014-09-23 07:22:45 26041 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
  19. 2014-09-23 07:22:45 26041 [Warning] InnoDB: New log files created, LSN=45781
  20. 2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer not found: creating new
  21. 2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer created
  22. 2014-09-23 07:22:45 26041 [Note] InnoDB: 128 rollback segment(s) are active.
  23. 2014-09-23 07:22:45 26041 [Warning] InnoDB: Creating foreign key constraint system tables.
  24. 2014-09-23 07:22:45 26041 [Note] InnoDB: Foreign key constraint system tables created
  25. 2014-09-23 07:22:45 26041 [Note] InnoDB: Creating tablespace and datafile system tables.
  26. 2014-09-23 07:22:45 26041 [Note] InnoDB: Tablespace and datafile system tables created.
  27. 2014-09-23 07:22:45 26041 [Note] InnoDB: Waiting for purge to start
  28. 2014-09-23 07:22:45 26041 [Note] InnoDB: 5.6.19 started; log sequence number 0
  29. A random root password has been set. You will find it in '/root/.mysql_secret'.
  30. 2014-09-23 07:22:46 26041 [Note] Binlog end
  31. 2014-09-23 07:22:46 26041 [Note] InnoDB: FTS optimize thread exiting.
  32. 2014-09-23 07:22:46 26041 [Note] InnoDB: Starting shutdown...
  33. 2014-09-23 07:22:48 26041 [Note] InnoDB: Shutdown completed; log sequence number 1625977
  34. 2014-09-23 07:22:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
  35. 2014-09-23 07:22:48 26065 [Note] InnoDB: Using atomics to ref count buffer pool pages
  36. 2014-09-23 07:22:48 26065 [Note] InnoDB: The InnoDB memory heap is disabled
  37. 2014-09-23 07:22:48 26065 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  38. 2014-09-23 07:22:48 26065 [Note] InnoDB: Compressed tables use zlib 1.2.3
  39. 2014-09-23 07:22:48 26065 [Note] InnoDB: Using Linux native AIO
  40. 2014-09-23 07:22:48 26065 [Note] InnoDB: Using CPU crc32 instructions
  41. 2014-09-23 07:22:48 26065 [Note] InnoDB: Initializing buffer pool, size = 128.0M
  42. 2014-09-23 07:22:48 26065 [Note] InnoDB: Completed initialization of buffer pool
  43. 2014-09-23 07:22:48 26065 [Note] InnoDB: Highest supported file format is Barracuda.
  44. 2014-09-23 07:22:48 26065 [Note] InnoDB: 128 rollback segment(s) are active.
  45. 2014-09-23 07:22:48 26065 [Note] InnoDB: Waiting for purge to start
  46. 2014-09-23 07:22:48 26065 [Note] InnoDB: 5.6.19 started; log sequence number 1625977
  47. 2014-09-23 07:22:48 26065 [Note] Binlog end
  48. 2014-09-23 07:22:48 26065 [Note] InnoDB: FTS optimize thread exiting.
  49. 2014-09-23 07:22:48 26065 [Note] InnoDB: Starting shutdown...
  50. 2014-09-23 07:22:50 26065 [Note] InnoDB: Shutdown completed; log sequence number 1625987
  51. A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
  52. You will find that password in '/root/.mysql_secret'.
  53. You must change that password on your first connect,
  54. no other statement but 'SET PASSWORD' will be accepted.
  55. See the manual for the semantics of the 'password expired' flag.
  56. Also, the account for the anonymous user has been removed.
  57. In addition, you can run:
  58. /usr/bin/mysql_secure_installation
  59. which will also give you the option of removing the test database.
  60. This is strongly recommended for production servers.
  61. See the manual for more instructions.
  62. Please report any problems at http://bugs.mysql.com/
  63. The latest information about MySQL is available on the web at
  64. http://www.mysql.com
  65. Support MySQL by buying support/licenses at http://shop.mysql.com
  66. New default config file was created as /usr/my.cnf and
  67. will be used by default by the server when you start it.
  68. You may edit this file to change server settings

最后一段中提示了重要信息,很多人因为不喜欢读英文,导致接下来不知道怎么操作!


二就是安装完成,启动服务之后

使用命令:“mysql -uroot -p”输入你之前安装后设置的密码,看能不能登录,如果还可以登录,说明没有卸载干净!

CentOS下如何完全卸载MySQL相关推荐

  1. CentOS下如何完全卸载MySQL?解决卸载不干净的问题

    出处:https://my.oschina.net/zhangjie830621/blog/466279 CentOS下如何完全卸载MySQL?解决卸载不干净的问题 系统:CentOS 6.5,MyS ...

  2. centos怎么样快速卸载mysql_CentOS下如何完全卸载MySQL?卸载自带的mysql

    CentOS下如何完全卸载MySQL?解决卸载不干净的问题 系统:CentOS 6.5,MySQL:MySql 5.6 这里主要解决使用rpm安装的卸载问题,安装方法见:CentOS安装mysql*. ...

  3. 如何在centos中完全彻底卸载mysql

    CentOS 下如何完全卸载MySQL?解决卸载不干净的问题 系统:CentOS 6.5,MySQL:MySql 5.6 这里主要解决使用rpm安装的卸载问题,安装方法见:CentOS安装MySQL* ...

  4. MySQL——在Linux下安装和卸载MySQL

    MySQL--在Linux下安装和卸载MySQL 摘要:本文主要学习了如何在Linux系统中安装和卸载MySQL数据库. 查看有没有安装过MySQL 使用命令查看有没有安装过: 1 [root@loc ...

  5. CentOS下安装及配置MySQL

    大家好,我是中国码农摘星人. 欢迎分享/收藏/赞/在看! 欢迎提出使用本篇文章安装 MySQL 时遇到的问题,本篇文章会持续更新- MySQL 是一个关系型数据库管理系统,由瑞典 MySQL AB 公 ...

  6. 在CentOS下安装apche+tomcat+mysql+php

    在CentOS下安装apche+tomcat+mysql+php 本例中所用到的软件 Apache 2.2 Sun的JDK-1_5_0_12-linux-i586 MySQL: mysql-5.0.4 ...

  7. windows 7下如何卸载重装mysql 压缩包版百度经验_windows下安装、卸载mysql服务的方法(mysql 5.6 zip解压...

    MySQL是一个小巧玲珑但功能强大的数据库,目前十分流行.但是官网给出的安装包有两种格式,一个是msi格式,一个是zip格式的.很多人下了zip格式的解压发现没有setup.exe,面对一堆文件一头雾 ...

  8. nginx 怎么重新编译安装mysql,centos 下 编译安装 nginx + mysql + php 服务

    centos 下编译安装nginx + mysql + php 服务 1.安装nginx 1.1.安装依赖包 yum install wget make gcc gcc-c++ pcre-devel ...

  9. linux 卸载glibc,CentOS下glibc库卸载恢复

    CentOS下glibc库卸载恢复 CentOS glibc 在yum update或是手动更新glibc过程中,手残卸载glibc之后系统将缺失一些核心函数如cd/ls/cp等等,几乎废掉. 在保持 ...

最新文章

  1. C#获取文件的当前路径
  2. Python 解决 :NameError: name ‘reload‘ is not defined 问题
  3. 使用Java方法实现 Double和String相互转化
  4. ios 请求头设置token_HTTP中的OPTIONS请求
  5. python鸡兔同笼编程运行结果_Python少儿编程:鸡兔同笼
  6. 专业设计师是哪里找到高质量素材的!
  7. Apache Dubbo集群容错
  8. 【java进阶之路】(并发编程篇)1.Java线程
  9. 读 《.Net 之美》解析.Net Remoting (应用程序域)-- Part.1
  10. html flash带播放视频源码,HTML嵌套Flash播放视频
  11. OpenCASCADE7.6编译
  12. cmd连局域网mysql_cmd连接局域网mysql
  13. 字节跳动java后端一面面经(头条/西瓜视频)
  14. Vue实现导出Excel功能
  15. 如何合理运用美容院资源
  16. 基于面向对象实现:猫抓老鼠小游戏 有一只猫和一只老鼠,当猫的体重是小于老鼠体重的5倍时,猫可以抓到老鼠。
  17. 微机原理与接口技术课内实验-NUAA-Masm for Windows
  18. 嵌入式linux备份flash,嵌入式Linux裸机开发(十一)——Nandflash
  19. studio 热重载应用_热重载 (Hot reload)
  20. 原生js快速查找指定元素

热门文章

  1. java修改服务器文件名,批量修改文件名 java代码
  2. 一键获取速卖通商品详情
  3. 王桂林 C++视频 学习笔记
  4. 大端字节序与小端字节序 (网络字节序与主机字节序)
  5. 微信小程序 - 从入门到入土
  6. 海滩上有一堆桃子,五只猴子来分
  7. 欧姆龙PLC-CP1H与fanuc机器人走eip配置文档
  8. 报错解决:[nodemon] app crashed - waiting for file changes before starting...
  9. python 12306登录 2019_python爬虫--模拟12306登录
  10. 8-5以下面四个标签(读写器范围内)为例说明二进制树型搜索算法选择电子标签迭带过程