how to uninstall mariadb in ubuntu code example

Example 1: uninstall mariadb server and client in ubuntu 18.4

sudo systemctl stop mysql
sudo apt-get remove --purge mysql-server mysql-client mysql-common

Example 2: remove mariadb

$ sudo apt-get purge mariadb-server

Example 3: uninstall mariadb server and client in ubuntu 18.4

sudo apt-get autoclean
sudo rm -rf /var/lib/mysql/
sudo rm -rf /etc/mysql/

Example 4: uninstall mariadb server and client in ubuntu 18.4

sudo apt-get autoremove