7

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:

  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!

  • 1
    Does your server meet the requirements? What version are you upgrading from? I tend to find a bullet-proof fix is to download the latest version, extract, then upload & overwrite via FTP. – TheDeadMedic Jun 24 '13 at 23:59
  • when you do #4 (restore the database) does WordPress allow you to log in? If so are you then asked to upgrade? Also like @TheDeadMedic said are you going from 3.5.1 to 3.5.2 or something else? – Brooke. Jun 25 '13 at 5:34
  • @TheDeadMedic - The server requirements are met (PHP 5.3.26 and MySQL 5.5.32) and the last upgrade I did was about three months ago, so that will have been 3.5.1. I tried a manual install (via FTP) but still got the same issue ;( – rkhff Jun 25 '13 at 12:53
  • @BandonRandon - No, it doesn't. I thought restoring the database would definitely solve the issue but it didn't. – rkhff Jun 25 '13 at 12:56
  • 1
    Looks like it could be a theme problem according to this support question on WP.org wordpress.org/support/topic/database-update-required?replies=9 (yes I know its two years old) – Brooke. Jun 25 '13 at 18:03
19

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 www.clickonf5.org/2247/.

  • 1
    You are GOD!!!! – akshaynagpal May 22 '17 at 12:42
  • I agree with the above. Lifesaver! – Joseph Aug 31 '17 at 5:10
  • Excellent quick fix. Seems the update script either timed out before it updated the DB row, or some other problem prevented a correct update. Either way, I manually updated the database to match the WP version string, then enabled WP's inbuilt WP_ALLOW_REPAIR, ran a database upgrade & optimisation (after full backup!) and all came back 100% OK. Perfect, saved me hours. – Chris Woods Jul 5 '18 at 18:42
4

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.

  • 1
    Soooo the exact same procedure in the answer given two years prior? :) – rinogo Nov 16 '17 at 20:24
2

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

1

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.

0

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

0

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)

0

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.

0

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.

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