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.
Related Posts:
- Subscribers become Authors after Upgrade? / Mass Update of Users?
- An update has caused my client’s site to be non-existent after new update of WordPress [closed]
- Remove “Time to upgrade” message from dashboard
- wp-admin pages return ERR_EMPTY_RESPONSE
- When attempting to update a self-hosted WordPress site, I’m seeing “ASN1 unknown message digest algorithm”
- How can I allow core, plugin, theme update checks only for selected admins?
- Customise WordPress Update Notice in wp-admin backend area
- Unable to locate WordPress Root directory
- WP-Admin shows (1) update but there is no update for plugin, theme or WordPress
- wp-admin throwing 500 errors after update to 4.2.1
- Can I hook into wp_update_core outside of the admin?
- “WordPress installations is currently out of date” problem with difficult situation [closed]
- Site Crashes When Updating to WordPress (Version 3.6)
- How to allow WordPress updates to only one specific administrator?
- Why when I try to access to this old WordPress site it is opened the installation page?
- wp_get_update_data() function running on every admin request
- Error messages & can’t reach admin after upgrading to 3.4.1 WordPress
- Slow WP loading due to persistent version check, how to disable?
- Updated to wordpress 5.5.1 doesn’t work
- Custom Admin Message from external source to multiple users
- Cannot Update wp DB – Get 500 Error
- Couple questions about .htaccess, login page, updates
- After Upgrade: $user becomes unknown (id: 0) after successful login?
- adding the category to the admin column for a custom post type?
- Change page title in admin area
- How to filter by post-format in admin?
- Make fonts.com font work in TinyMCE (iframe referrer issue)
- Securing wp-admin folder – Purpose? Importance?
- stop redirection on /wp-admin call to /wp-login
- Updating WordPress – the best approach (updating wp core, plugins and db)
- Wp3.5 Media Gallery Edit modal: change captions to title
- Opening specific posts on WP takes lot of time and freezes the editor
- Is it possible to set a option, and then redirect to another page directly from a admin notice link?
- How to load a CSS file into WordPress admin area using Child Theme? [closed]
- Getting “Cannot modify header information – headers already sent” error, but only on backend
- Cookie value cannot be read until I’ve logged into the WP admin
- How to inhibit dashboard and profile management access to normal users?
- What corrections does this code need?
- Admin Blank Page with Working Front-End After Updating to WordPress 4.6
- Password reset link becomes invalid immediately [closed]
- Get which template being in use within WordPress-admin
- special characters after saving draft interpreted as �
- WordPress and bbPress Login conflicts?
- /wp-admin/ works but website doesn’t load
- WP 5 upgrade and ALTER TABLE wp_post … post_password
- How can I use a variable to include a linked image?
- Add css code in admin_enqueue_scripts
- Add custom list menu on Posts page in admin panel
- Does it matter if two people are using the same WordPress admin account?
- Use Password Protected Form without the use of wp-login.php
- redirect to a dedicated sign in page
- More than one admin logged in?
- Too many redirects after added SSL redirect on port 80 virtual host
- Register page in admin area
- load-{$page hook} and returned parameter
- Custom plugin admin page issues
- Making Comments, a sub_menu in admin menu
- Without using wordpress cms Is it possible to signup from my html page
- Customising Word press Admin – Add Post Page functionality to another similar page
- How to add ‘Insert HTML Table’ button to TinyMCE in admin?
- Environment to do updates to legacy (4.7) version of WP while staying on php 5.6?
- How can I remove commas when adding tags?
- Displaying Title in Title Tag on Edit page?
- How to add custom CSS and JavaScript file for wp- admin dashboard (backend)
- GoDaddy hosting wp-admin problem
- How can I remove unwanted word on my WP site?
- Add custom fields to a page template, admin side
- Newly created user role not displaying on users screen
- issue with wordpress [wp-admin] redirects, when using kubernetes ingress hosting two wordpress websites using path
- Toggle between block ‘edit content’ and ‘select’ not properly working in WordPress Admin
- WordPress Admin extremely slow when other admin logged in
- Can’t acces login on new site
- WordPress Admin Panel Left Sidebar No showing on Post create page
- WordPress Migration Post Problems
- After changing Site http to https, can’t access wp login page with a digitalocean hosting
- Can’t access WP-Admin via HTTPS
- wp-admin and wp-login.php not Accessible after Cloudflare
- stop customize.php redirect to login page if admin is not logged in
- Random authentication failures on a load balanced WP setup
- Can I get programmatic access to wp-admin?
- Strange URLs admin area bug
- remove_query_arg on options.php
- wp.svgPainter cannot init error, causing issues with admin panel
- mysql_escape_string PROBLEM
- Cannot access my wordpress website
- Organising and display thousands of photos in media library
- Custom comment action
- Problem with admin columns
- get_current_screen – ‘Trying to get property of non-object’ error
- Added fields in quick edit screen need to update at the moment
- Block tools menu in wp-admin?
- is_admin() triggers error
- Modify admin panel tab position
- not able to add thumbnail custom field in dropdown
- No wp-admin, wp-config, or .htaccess folder/file
- Taking over a WordPress site
- wordpress admin is broken [closed]
- LinkControl not showing suggestions when used on admin page
- Extend user search in the Wp backend area on the users.php page to allow for searching by email domain and role from the “users search” input box
- Cannot Access wp-admin