Note that the following steps will completely purge your MariaDB, configs and all other setup.
- Completely remove the current MariaDB package:
In the command below, note that purge has 2 hyphens in front of it.
sudo apt-get --purge remove "mysql*" # Note that purge has 2 hyphens in front of it.
- Remove the MariaDB configuration files:
sudo rm -rf /etc/mysql
- Remove the MariaDB data directory:
sudo rm -rf /var/lib/mysql # You can also remove old log files sudo rm -rf /var/log/mysql
- Remove the MariaDB system user and group:
sudo userdel -r mysql sudo groupdel mysql
To reinstall mariaDB do:
sudo apt install mariadb-server mariadb-client
Start and enable (start at reboot) Mariadb
sudo systemctl start mariadb && sudo systemctl enable mariadb
Then secure it by following the prompts that follow from this command :
sudo mysql_secure_installation