I installed MariaDB on CentOS 7 but I had some problems with some configuration, now it is completely misconfigured.
Thus, I wanted to remove the MariaDB with “yum remove mariadb mariadb-server”, after that I reinstalled it with “yum install mariadb mariadb-server”.
Unfortunately, the configuration remains. It seems as if yum remove don’t delete all MariaDB Config-Files.
How can I remove MariaDB completely from CentOS 7?
To update and answer the question without breaking mail servers. Later versions of CentOS 7 have MariaDB included as the base along with PostFix which relies on MariaDB. Removing using yum will also remove postfix and perl-DBD-MySQL. To get around this and keep postfix in place, first make a copy of /usr/lib64/libmysqlclient.so.18 (which is what postfix depends on) and then use:
then remove the mariadb packages using (changing to your versions):
Delete left over files and folders (which also removes any databases):
Put back the copy of /usr/lib64/libmysqlclient.so.18 you made at the start and you can restart postfix.
There is more detail at https://code.trev.id.au/centos-7-remove-mariadb-replace-mysql/ which describes how to replace mariaDB with MySQL
systemd
sysvinit
These steps are working on CentOS 6.5 so they should work on CentOS 7 too:
yum remove mariadb mariadb-server
rm -rf /var/lib/mysql
If your datadir in /etc/my.cnf points to a different directory, remove that directory instead of /var/lib/mysqlrm /etc/my.cnf
rm ~/.my.cnf
yum install mariadb mariadb-server
[EDIT] - Update for MariaDB 10.1 on CentOS 7
The steps above worked for CentOS 6.5 and MariaDB 10.
I've just installed MariaDB 10.1 on CentOS 7 and some of the steps are slightly different.
Step 1 would become:
Step 5 would become:
The other steps remain the same.