How to reset your MySQL or MariaDB root password

Forgotten your MySQL or MariaDB root password? Don’t worry, it’s not the end of the world. You can reset your MySQL or MariaDB root passwords, provided you have access to the server and a sudo-enabled…