What is the method for uninstalling Mariadb on Linux?

To uninstall MariaDB, you can follow these steps:

  1. Open the terminal and log in to the Linux system with administrator privileges.
  2. Use the following command to stop the MariaDB service:
  3. Disable the mariadb service using systemctl.
  4. Use the following command to remove the MariaDB software package:
  5. If you are using a Debian or Ubuntu system, please type the following: sudo apt-get remove –purge mariadb-server mariadb-client mariadb-common
  6. If you are using a CentOS or RHEL system, please enter: sudo yum remove mariadb-server mariadb-client mariadb
  7. After removing the software package, input the following command to delete MariaDB’s data directory and configuration files:
  8. If you are using Debian or Ubuntu system, please enter: sudo rm -rf /var/lib/mysql /etc/mysql
  9. For CentOS or RHEL systems, please enter: sudo rm -rf /var/lib/mysql /etc/my.cnf
  10. Use the following command to remove any remaining MariaDB files and directories in the system:
  11. 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.

广告
Closing in 10 seconds
bannerAds