# mysql -u root
MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> update user set password=PASSWORD("my-new-cool-password") where User='root';
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> update user set plugin='' where User='root';
MariaDB [mysql]> quit;
Bye
# systemctl restart mariadb