I just installed MySQL on Ubuntu and the root user can\'t log in :)
How can I recover or find out my password? Using blank for password does not work.
Hmm Mysql 5.7.13 to reset all I did was:
$ sudo service mysql stop
To stop mysql
$ mysqld_safe --skip-grant-tables &
Start mysql
$ mysql -u root
Just like the correct answer. Then all I did was do what @eebbesen did.
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('NEW-password-HERE');
Hope it helps anyone out there :)