This comes up many times when you need to add a backup super user to MySQL (or MariaDB). Passwords are lost, forgotten, etc and although MySQL allows for a fairly quick password reset, it is always a good idea to have a backup.
Login as root and run the following query. It will add a new user, called "sysadminuser", with access to localhost (ie: the current machine locally). This new user will be allowed to login using the password: "passwordfortheuser". (Change these as needed):
mysql> GRANT ALL PRIVILEGES ON *.* TO sysadminuser@localhost IDENTIFIED BY 'passwordfortheuser' WITH GRANT OPTION;
mysql> flush privileges;
The second line is just flushing the privileges.