This question already has an answer here:
I'm just starting with MySQL (version 5.7.20 on Xubuntu 16.04), and in playing around with it I changed the root password. Now I can't log in as root -- I either forgot the password or didn't set it to what I thought I did. This is my home hobby system, so I'm the only user.
I may as well start over. But it's not clear to me how to do that. On Ubuntu there are about 9 or 10 mySQL packages involved, and I'm not sure I can uninstall all of them cleanly. I'm happy to just trash the database if I only knew the commands to start with a new one.
I could use some advice, preferably from someone who knows how it works on Ubuntu and it's variants, as these packages are managed by Canonical and are not necessarily like even the Debian ones.