If you have problem login to Drupal after some configuration changes or update, you can try the following steps:
- Try login using different browser, if you can login using another browser, likely a cookie problem.
- Clear the problem browser cookie of your site
- Try login again
If the above does not work, you can try edit sites/yoursite/settings.php
- specify the $base_url
- OR this fix to comment out the cookie section
Happy drupal-ing 
THANK YOU. Saved me much aggravation. Was trying to go through and change password in MySQL, but ran into your post just in time.
I had this problem and none of the solutions about or on Google fixed it. In my case, I was using CKEditor and there were three domains which could point to the site. In the Drupal settings.php file, there's a line which starts
$cookie_domainsome features of CKEditor require this, but it meant that when I accessed the site on a domain different to the one set here, I got 'access denied' even when logging in as admin.
To fix this, I set some redirects in the .htaccess file so that all access to the website would come through the one, authorised domain. Job done.
You made my day. Thank you.
Exellent, removing cookies worked for me. Strange things can happen with cookies when you're regularly changing code and updating files ...
Thanks
Dawn