Not able to access admin panel after updating WordPress database fails

After upgrading to WordPress 3.5.2 I can’t log in to the control panel anymore. Instead, I’m redirected to /wp-admin/upgrade.php?_wp_http_referer=%2Fwp-admin%2F where I’m presented with a ‘Database Update Required’ message and an ‘Update WordPress Database’ button. When I click on the button the page reloads, runs for a couple of seconds, and then nothing happens. All I get is a screen with the WordPress logo at the top and nothing else. The URL of the page is /wp-admin/upgrade.php?step=1&backto=%2Fwp-admin%2F.

I’ve tried various things to resolve the issue, without luck:

Read More
  1. Wait for an hour to see if the problem goes away (the first page
    does say that “the update process may take a little while”)
  2. Tried to click the button in four different browsers
  3. Checked the server’s error log (no errors at the time of the upgrade)
  4. Restored the database (I made a backup before I started the upgrade)
  5. Renamed the folder of my theme
  6. Renamed the plugins folder

The only other solution I can think of is downgrading WordPress to an older version. Does anyone have a better idea please?

PS – While searching for a solution I noticed a similar query was closed as “too localized”. However, I reckon this is an issue “generally applicable to the worldwide audience of the internet”. I’m not the first person to come across this issue, nor do I think I’ll be the last!

Related posts

9 comments

  1. The problem, it turns out, was that the db_version field in the wp_options table and the wp_db_version variable in the file /wp-includes/version.php didn’t match. In my case (an upgrade to 3.5.2) the database showed “22441” while the PHP file showed “22442”. Changing the number in the database to “22442” solved the issue.

    I’m not quite sure if this is a proper fix – I suspect the ‘Update Database’ script does more than just updating the db_version field. But… I can log in again and the dashboard tells me I’m using the latest version of WordPress.

    For a more detailed explanation (with screen dumps) and a second possible solution, see http://www.clickonf5.org/2247/.

  2. Check file “/wp-includes/version.php” $wp_db_version = [some number value] against the database options table’s options_value. They should have the same number value. If those numbers are not the same, change the value in the options table to match the value in the version.php file.

  3. Look in file called version.php in wp-includes directory:

    * @global string $wp_version
    */
    $wp_version = '4.3.2';
    
    /**
    * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
    *
    * @global int $wp_db_version
    */
    $wp_db_version = 33055;
    

    And verify if the wp_version and DB_version is the SAME in your website.

    The db_version you can look for in phpMyAdmin. For the version of WP, check the last update you made in your website.

  4. Well I have a very perfect answer for you. The problem occurs only when your server database need an update.

    Here is the step by step EASY process How I solved my problem very easily

    1. Open File Manager of your webhosting account

    2. Navigate to plugin folder (located in wp-content)

    3. Rename the plugin folder to plugins123

    4. Visit your website /wp-admin page

    Your browser will automatically redirected to this page.

    Click on the Update WordPress Database button and once the database update completed, go back to the File Manager and rename your plugin folder back to plugins

    The process was taken from http://www.vashistha.in/2016/12/problem-solved-upgradephpwphttpreferer2.html

  5. I work for a web hosting company. See this error time and time again. Easy fix

    1. Go into phpmyadmin

    2. Select all the tables and run repair

    Now go back to yousite.com/wp-admin and when prompted for database update accept. Voila! It will run and complete and work this time.

  6. Thanks, had the same problem and your solution worked for me too! Thank you so much for sharing this, you saved me a lot of time and I appreciate it!

    After I tried this solution and it worked I found this one which suggests uploading the upgrade.php file from a clean download of the WordPress version you are upgrading to. I uploaded it and then browsed to the upgrade.php page and got the update the database button and updated the db successfully. So you might want to finish off with that step just to be sure everything in database is also what the installed version expects.

    http://wordpress.org/support/topic/352-update-cant-access-admin-area?replies=8

  7. Make Sure your database has mysql:mysql Permissions

    Depends on your install:
    chown -R mysql:mysql /var/lib/mysql
    or
    chown -R mysql:mysql /var/lib/mysql/YourDatabaseName
    should fix all your databases.

    If you do not know the exact path do:
    find / -name YourDatabaseName (found in wp-config)

  8. That worked with the change that you have to temporary rename:
    wp-content/plugins to wp-content/plugins123
    Then go again to blog/wp-login and you are redirected to the db upgrade page.
    The issue is caused by some security plugin that denies access to the database upgrade page. In my case was WorldFence.

  9. I have an alternative solution. For me, the problem was that I was using the redis object cache, and it turns out that the wp_db_version was not updated in the redis cache after the wp update. To repair, I just had to flush my redis cache, and the problem was gone.

Comments are closed.