Upgrading to 2.7 from which version?
Before doing anything below suggest trying to clear the server cache by doing directly to:
http://yoursite/admin/purgecaches.php
or, if you have command line access:
cd moodlecode/admin/cli/
php purge_caches.php
That doesn't require a browser and sessions are not an issue.
Moodle setup ... DB on the same server as the code? or do you have a dedicated DB server?
Either way. have tried to access just the DB/or DB server from the Web server?
If it's a sessions issue, suggest adding $CFG->dbsessions=0; to config.php file and attempt to login. That should have moodle auto create a 'sessions' folder in moodledata. AND use file based sessions instead of DB.
Could always turn on debugging via config.php by copying the debugging lines from config-dist.php file and putting them into config.php.
'spirit of sharing', Ken