I just freshly installed Magento(1.7.0.2) on my localhost(LAMP). Now after installation when I wanted to go for the admin panel it asked me for the username and
**As mentioned by james. This method worked for me. This is a better option rather than changing the code. It worked for me for 127.0.0.1 as well as localhost and after deleting app/etc/local.xml. Delete the browser cookies. Run in your browser the installation of magento
localhost/magento/index.php.install.htm
and set your username & password again. Login to your admin panel. I didn't have to delete the database of magento so my data was safe.****