Issue
I tried command
yum remove mariadb mariadb-server
It removed the client but failed to remove the 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
Any suggestions?
Solution
I reinstalled MariaDB and then uninstalled using rmp not yum. Below are the steps I performed-
Downloaded the required RPMs
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
Install it again
rpm -ivh MariaDB-5.5.41-*.rpm
Erase packages
rpm -e `rpm -qa | grep MariaDB` --noscripts
Remove the config files
rm -rf /var/lib/mysql
rm /etc/my.cnf
Answered By - Newton Sarker Answer Checked By - Dawn Plyler (WPSolving Volunteer)