Reset mysql root password

I have some websites running with mysql as the database backend. When I initially set the databases up, I didn’t bother setting up a root password and instead instructed mysql to use a random root password (MYSQL_RANDOM_PASSWORD=yes). I also didn’t bother to write down the generated password. Now I ran into a situation where I …