Reset MariaDB root password

If you forget your (MariaDB) root password then you can reset MySQL (MariaDB) root password

As first stop MySQL MariaDB, then start Mysql in safe modus without grant-tables

systemctl stop mariadb
mysqld_safe --skip-grant-tables &

Now login as root but without password, then update your mysql root password with a new password

mysql -u root

use mysql;
update user SET PASSWORD=PASSWORD("newpassword") WHERE USER='root';
flush privileges;
\q

and restart MariaDB

systemctl restart mariadb

now you can try to login using your new mysql root password

mysql -u root -p

Links:
Change MariaDB Root Password