11

I just updated to 3.1.3 and now when I go to the admin I get the "Database Update Required" /wp-admin/upgrade.php screen. I click 'Upgrade Now' and it says it's done, but then trying to access anything in the admin gets me the same screen again. How do I get past this?

EDIT: In trying to use toscho's solution, I discovered that my wordpress db tables are not writable, which likely led to the error loop. Any ideas for how to track that down?

7 Answers 7

9

I had the same problem recently. For some reason the option db_upgraded isn’t set by the upgrade process.

Fix

  1. Go to /wp-admin/options.php.
  2. Fill the field db_upgraded with a 0 (zero).
  3. Hit Save Changes.

Done.

7
  • 1
    Where is that option ultimately stored? I can't get to /wp-admin/options.php without logging in, which shows the error message in my original post. Commented Jul 5, 2011 at 5:50
  • Found the setting in the wp_options table, but phpMyAdmin won't let me edit it because the table is 'Read only' which is probably why the value wasn't set and is the root of my problem. Commented Jul 5, 2011 at 5:53
  • @John Sheehan Something is really wrong with your DB setup. Make a backup, then try the repair option in phpMyAdmin. If it doesn’t help make the table writable manually.
    – fuxia
    Commented Jul 5, 2011 at 5:57
  • Yeah, you're right. I think I know what it's related to. Working to get the permissions on the db files set correctly. Commented Jul 5, 2011 at 6:02
  • @fuxia The db_upgraded option only appears in the db and not in the options.php file. Commented Jun 2, 2019 at 7:25
5

If you didn't disable all your plugins before updating do it manually by renaming the wp-content/plugins directory.

Clear your browsers cache and all cookies and try again.

If your still having the problem open the file wp-includes/version.php to make sure it is the correct file for 3.1.3.

You should see this database version:

/**
 * The WordPress version string
 *
 * @global string $wp_version
 */
$wp_version = '3.1.3';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
 *
 * @global int $wp_db_version
 */
$wp_db_version = 17516;

If everything checks out and your still having the problem add this to your wp-config.php file:

define('WP_ALLOW_REPAIR', true);

Navigate to : yoursite.com/wp-admin/maint/repair.php to attempt a database repair.

What WordPress version are you updating from?

3

Discovered that the db files I copied over from another machine had incorrect ownership. Once I chown -R mysql:mysql myblogdbdirectory and restarted MySQL, the database upgrade worked.

1
  • I also had to clear my cache to get the wp-admin access.
    – Aurovrata
    Commented Jun 12, 2022 at 17:18
0

I just had the same problem and I got to see there was no space left on device. Database could not save data, so it could not update. For some users, it is worth checking.

0

For me it was permissions of the DB user and the DB. They were too strict, once I gave the user ALL privileges, I was able to get passed the loop.

Either fix the user permissions of your SQL user, or use root if you have access to that SQL user.

0

I solved this issue by using the core upgrade-db function of the WP-CLI project. It's designed to perform exactly the same task, but using the command line instead of the web.

-1

For me, the solution was to restart memcached. We're using the Memcached plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.