Mysql Mariadb Tips and Fixes - pavangayakwad/scripts GitHub Wiki

How to completely remove mariadb

sudo apt-get purge mariadb-*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql

How to update root user password

More detailed steps: https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

flush privileges;

For older versions:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new-password';