Don't know root password for mysql

I installed mySQL using

sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
 didn't notice any request for a password, perhaps I missed it as it took a long while. 
I cannot access mysql using
mysql -u root -p
as I don't have a password. Is there any way around this?
I thought of reinstalling it but it says it is already the latest version. 
How do I remove it so I can reinstall and avidly wait for the password prompt?

This may help: https://www.techrepublic.com/article/how-to-set-change-and-recover-a-mysql-root-password/

1 Like

Thanks arb I managed to find that myself and it worked.

As a side note if you want to remove packages just use
sudo apt-get remove package-name
So for example:

sudo apt-get remove mysql-server
sudo apt-get remove python-mysqldb

Not sure if this also helps but a quick workaround is to use the login command as sudo.
“sudo mysql -u root”

I had the same issue and that seem to help me get around it.