How to fix WordPress 3.5.2 Database Update Required error

I just updated to the latest WordPress 3.5.2 maintenance update, but when I clicked the “Update WordPress Database” I ended up in another page that only displayed the WordPress logo. After trying to complete the database update several times I also stumbled upon an error that looked something like this: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35 bytes) in /home/html/wp-includes/wp-db.php on line 1499.

The database message said the following:

“Database Update Required
WordPress has been updated! before we send you on your way, we have to update your database to the newest version.
The update process may take a little while, so please be patient.”

Of course, when updating WordPress and things don’t work as expected, I started to panic a little bit, so I did some research and I found out that I wasn’t the only one with the problem updating to WordPress 3.5.2. The solution to the problem I discovered at the WordPress forum and in my case was a memory issue.

So, what you have to do is to add increase the memory limit in your wp-config.php file by using the following line of code:

define(‘WP_MEMORY_LIMIT’, ‘128M’);

Save the file back to your server, go to your and click “Update WordPress Database” one more time and it should work. Remember that you can increase PHP memory Limit in .htaccess or local php.ini file.