How to stop – Database Update Required – from happening again?

So I have had the issue several times now where whenever I update WordPress it gives me the “DataBase update required” and then will not login in to the site. This happens every time I upgrade to the newest version of WordPress.

My fix for this issue is to set the db_upgraded field in wp_option table in the database and purging the cache.

Fix Database update required

However what I want to know is, how can I stop this happening again? What is happening to bring up this error? Why is WordPress ending up in this loop?

Now I could understand there could be various reasons but if anyone has had any success with solving this issue your help would be greatly appreciated.

Solutions Collecting From Web of "How to stop – Database Update Required – from happening again?"

Was a bug in the core, I published the ticket ( https://core.trac.wordpress.org/ticket/32310 ) and is added for the next version 4.2.3.

In this version the code change the collation of some tables and this works fine if the change is fast. But in big tables this change take time, hive a timeout in the upgrade process and can’t continue, so is a loop.

In your case, the cache data was the reason of the big table size, then you clean the cache, the table is small and you can continue the upgrade. In case you can’t “clean” de wp_options table you can replace this file https://core.svn.wordpress.org/branches/4.2/wp-admin/includes/upgrade.php , has the patch to solve this “loop”.

About your question “how can I stop this happening again?”, this was a bug, is not a wrong settings of your installation or a plugin or some like this.

I hope this help you.

I had the same issue and couldn’t find a solution. So through phpmyadmin _option I started deleting rows. The third row I deleted was theme_mods_twentythirteen. Once this was gone I had no trouble again! Fingers crossed…

Since using the core upgrade-db function of the WP-CLI project fixed it for me and performs exactly the same task, next time I would stop the issue by using the CLI for the upgrade instead.