What is the method for uninstalling Mariadb on Linux?
To uninstall MariaDB, you can follow these steps:
- Open the terminal and log in to the Linux system with administrator privileges.
- Use the following command to stop the MariaDB service:
- Disable the mariadb service using systemctl.
- Use the following command to remove the MariaDB software package:
- If you are using a Debian or Ubuntu system, please type the following: sudo apt-get remove –purge mariadb-server mariadb-client mariadb-common
- If you are using a CentOS or RHEL system, please enter: sudo yum remove mariadb-server mariadb-client mariadb
- After removing the software package, input the following command to delete MariaDB’s data directory and configuration files:
- If you are using Debian or Ubuntu system, please enter: sudo rm -rf /var/lib/mysql /etc/mysql
- For CentOS or RHEL systems, please enter: sudo rm -rf /var/lib/mysql /etc/my.cnf
- Use the following command to remove any remaining MariaDB files and directories in the system:
- Delete all files and directories with names containing “mysql” from the root directory.
After completing the steps above, MariaDB on your system should have been completely uninstalled.