如何从CentOS 7完全卸载MariaDB 5.5(包括配置)

时间:2016-01-10 04:50:25

标签: mysql linux mariadb centos7

我尝试了命令

yum remove mariadb mariadb-server

它删除了客户端但未能删除服务器。

error reading information on service mysql: No such file or directory
error: %preun(MariaDB-server-5.5.41-1.el7.centos.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package MariaDB-server-5.5.41-1.el7.centos.x86_64
error: MariaDB-server-5.5.41-1.el7.centos.x86_64: erase failed
Erasing    : MariaDB-client-5.5.41-1.el7.centos.x86_64                                                                                        1/2 
Verifying  : MariaDB-client-5.5.41-1.el7.centos.x86_64                                                                                        1/2 
Verifying  : MariaDB-server-5.5.41-1.el7.centos.x86_64                                                                                        2/2 

Removed:
MariaDB-client.x86_64 0:5.5.41-1.el7.centos                                                                                                       

Failed:
MariaDB-server.x86_64 0:5.5.41-1.el7.centos 

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

我重新安装MariaDB,然后使用 rmp 而不是yum卸载。以下是我执行的步骤 -

下载所需的RPM

wget http://archive.mariadb.org/mariadb-5.5.41/yum/centos7-amd64/rpms/MariaDB-5.5.41-centos7_0-x86_64-client.rpm
wget http://archive.mariadb.org/mariadb-5.5.41/yum/centos7-amd64/rpms/MariaDB-5.5.41-centos7_0-x86_64-common.rpm
wget http://archive.mariadb.org/mariadb-5.5.41/yum/centos7-amd64/rpms/MariaDB-5.5.41-centos7_0-x86_64-server.rpm

重新安装

rpm -ivh MariaDB-5.5.41-*.rpm

删除套餐

rpm -e `rpm -qa | grep MariaDB` --noscripts

删除配置文件

rm -rf /var/lib/mysql
rm /etc/my.cnf