从 CentOS 7 或 RHEL 7 中完全删除 MariaDB 或 MySQL

Completely remove MariaDB or MySQL from CentOS 7 or RHEL 7(从 CentOS 7 或 RHEL 7 中完全删除 MariaDB 或 MySQL)
本文介绍了从 CentOS 7 或 RHEL 7 中完全删除 MariaDB 或 MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 CentOS 7 上安装了 MariaDB,但我在某些配置方面遇到了一些问题,现在它完全配置错误.

I installed MariaDB on CentOS 7 but I had some problems with some configuration, now it is completely misconfigured.

因此,我想用yum remove mariadb mariadb-server"删除MariaDB,然后用yum install mariadb mariadb-server"重新安装.

Thus, I wanted to remove the MariaDB with "yum remove mariadb mariadb-server", after that I reinstalled it with "yum install mariadb mariadb-server".

不幸的是,配置仍然存在.好像 yum remove 并没有删除所有 MariaDB 配置文件.

Unfortunately, the configuration remains. It seems as if yum remove don’t delete all MariaDB Config-Files.

如何从 CentOS 7 中彻底删除 MariaDB?

How can I remove MariaDB completely from CentOS 7?

推荐答案

这些步骤适用于 CentOS 6.5,因此它们也应该适用于 CentOS 7:

These steps are working on CentOS 6.5 so they should work on CentOS 7 too:

(编辑 - 完全相同的步骤适用于 CentOS 8 上的 MariaDB 10.3)

(EDIT - exactly the same steps work for MariaDB 10.3 on CentOS 8)

  1. yum 删除 mariadb mariadb-server
  2. rm -rf/var/lib/mysql 如果 /etc/my.cnf 中的 datadir 指向不同的目录,请删除该目录而不是 /var/lib/mysql
  3. rm/etc/my.cnf该文件可能已在步骤 1 中删除
  4. 可选步骤:rm ~/.my.cnf
  5. yum install mariadb mariadb-server
  1. yum remove mariadb mariadb-server
  2. rm -rf /var/lib/mysql If your datadir in /etc/my.cnf points to a different directory, remove that directory instead of /var/lib/mysql
  3. rm /etc/my.cnf the file might have already been deleted at step 1
  4. Optional step: rm ~/.my.cnf
  5. yum install mariadb mariadb-server

[EDIT] - CentOS 7 上 MariaDB 10.1 的更新

[EDIT] - Update for MariaDB 10.1 on CentOS 7

上述步骤适用于 CentOS 6.5 和 MariaDB 10.

The steps above worked for CentOS 6.5 and MariaDB 10.

我刚刚在 CentOS 7 上安装了 MariaDB 10.1,其中一些步骤略有不同.

I've just installed MariaDB 10.1 on CentOS 7 and some of the steps are slightly different.

第 1 步将变为:

yum remove MariaDB-server MariaDB-client

第 5 步将变为:

yum install MariaDB-server MariaDB-client

其他步骤保持不变.

这篇关于从 CentOS 7 或 RHEL 7 中完全删除 MariaDB 或 MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)