Reset Root Password on MariaDB or MySQL
Step 1 - Stop MariaDB and Start it With Privileges
Run the following commands to stop the MariaDB service and start it with special privileges that won't require you to enter a password.
Step 2 - Change the Password
Reset the password using the following commands. Be sure to replace
PASSWORDHERE with the new password you want.
Step 3 - Restart MariaDB
Start the normal MariaDB service.