I have also observed this on one site when upgrading to 3.5.1. It is almost like the system is hanging yet the site seems ok. Just can’t login to admin. Will check again later as it may be doing a background change.
for 3.5.1 it looks like the version number inside /includes/version.php is as follows
$wp_db_version = 22441
This looks like it matches http://ww.wp.xz.cn/support/topic/upgraded-to-35-database-update-fails?replies=7 and that is now showing as resolved.
Ok – I have fixed my client site. Turns out I was upgrading from 3.4.2 up to 3.5.1 missing the step to 3.5 as it happens. In this case my db was about 500mb and it seems that a db that large can put extra stress on the memory and other server resources. That server had size limits on it that prevented large temp files from being managed on the server (as well as I suspect a memory limit. )
I also suspected that super-cache may have complicated the process / resource wise as I have noticed caching does sometimes effect auto upgrade more than other plugins.
In theory with an auto upgrade all plugins are deactivated by that process.
However when the .htaccess file and the wp.config file refer to some cache settings I decided to clean out .htaccess and wp.config to eliminate those parameters.
I also deactivated all the plugins by renaming the plugin folder to plugins.hold as recommended. This eliminates any interference from the all plugins so that a manual db upgrade can be attempted.
In my situation I was able to roll back to version 3.4.2 by doing a manual update. Since the db hadn’t upgraded the version numbers matched and it is all go again.
The roll back worked in this case but that might not work for everyone.
I would like to be able to do auto upgrade on that site in the future so after reviewing backups of the db file I will be looking to see if I can get it down from 500mb as there is some extra old unused tables in there.
The other item I looked at was making the memory limit 99mb. I added these 2 lines to my wp-config.php file
ini_set(‘display_errors’, 0);
define(‘WP_MEMORY_LIMIT’, ’99M’);
I have seen in other reports of similar errors that adding a php.ini file to do the same thing seemed to help but it made more sense for me to do that in the wp-config.php file.
What would be great in future is some theory on what causes these auto upgrades to fail.