Introduction
If it is not possible to reset the MySQL/MariaDB root password using WHM under "SQL Services » MySQL Root Password" then the following can be used to manually reset the password.
Procedure
Create a temporary file that will be readable by the mysql user like
/tmp/tmpinfo
Then obtain the root password for MySQL/MariaDB in /root/.my.cnf
Next modify /tmp/tmpinfo and copy and paste the following into that file updating the password.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'PASSWORD';
FLUSH PRIVILEGES;
Next shutdown mysql
/scripts/restartsrv_mysql --stop
Then access a shell as the mysql user with
sudo -i su -l mysql -s/bin/bash
and then use the file created to start MyQL with
mysqld --init-file=/tmp/tmpinfo &
and then test access to MySQL/MariaDB.
Afterward exit the mysql shell and restart MariaDB with
/scripts/restartsrv_mysql
and remove the temporary file
/bin/rm -f /tmp/tmpinfo