This assume you are able to log into your MariaDB or mySQL server or you have configured passwordless authentication and will be using the -e command line option. You may want to first SELECT USER to display the list of current users.
UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='the_username';
FLUSH PRIVILEGES;