I installed mysql 5.0.54 today on my gentoo system and then found out that I was unable to login. I started it in safe mode skipping the grant table and found out that there were no users setup
I did some googling around and found that I have to setup mysql (atleast when I install using gentoo ..ie from source). I tried to install it with the commant
<code>#emerge --config =dev-db/mysql-5.0.54</code>
However this would still not let me login because of some bug in mysql that has been reported here and officially here
I therefore changed my hostname to something other than localhost as described in the forum but still i could not connect as root. I finally looked at mysql_install_db help and found out that there is a way to skip name resolution and tried with that
#mysql_install_db --user=mysql --skip-name-resolve
#/usr/bin/mysqladmin -u root password 'new_password'
Voila .. it worked and i could login as root. I hope this is useful to someone