You don’t want to muck with the serialized arrays directly. The best way to handle this is to override the db configurations by editing the system/config.php file. You may need to go in and change the security settings and perhaps the cookie settings- and perhaps the path settings to the themes folder if you want things styled. Then, once you can log in, set all of the settings via the control panel- thus changing them in the db- and you can then remove them from the config.
The overrides I’d start with are:
$conf['cp_url'] = "http://mysite.com/system/index.php";
$conf['theme_folder_url'] = "http://mysite.com/themes/";
$conf['cookie_domain'] = ".mysite.com";
$conf['admin_session_type'] = "c";
To login, be sure your cookie_domain is correct- and don’t forget the beginning . - you may need to switch the admin_session_type between cookies- c - and sessions - s . Once you set your config variables, clear your cookies and try logging in again.