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:
- 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”) - Tried to click the button in four different browsers
- Checked the server’s error log (no errors at the time of the upgrade)
- Restored the database (I made a backup before I started the upgrade)
- Renamed the folder of my theme
- 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!
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/.
Check file â/wp-includes/version.phpâ
$wp_db_version = [some number value]
against the database options tableâsoptions_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 theversion.php
file.Look in file called
version.php
inwp-includes
directory:And verify if the
wp_version
andDB_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.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
Open File Manager of your webhosting account
Navigate to plugin folder (located in wp-content)
Rename the plugin folder to
plugins123
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
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.
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
Make Sure your database has
mysql:mysql
PermissionsDepends 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)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.
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.