Title: WordPress database error: [Got error 12 from storage engine]
Last modified: August 18, 2016

---

# WordPress database error: [Got error 12 from storage engine]

 *  Resolved [agovella](https://wordpress.org/support/users/agovella/)
 * (@agovella)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/)
 * I’ve been receiving this error intermittently, but it apprears to have returned
   and won’t leave. The full error message:
 * WordPress database error: [Got error 12 from storage engine]
    SELECT DISTINCT
   YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM
   wp_posts WHERE post_date < ‘2005-05-04 00:09:12’ AND post_status = ‘publish’ 
   GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198156)
 * I did a google search for “Got error 12 from storage engine”. The second result
   was this:
    [http://lists.mysql.com/mysql/182918](http://lists.mysql.com/mysql/182918)
 * >  Error 12 = Cannot allocate memory
 * Your server is running out of free memory. This is not a WordPress specific problem.
 *  [emt036](https://wordpress.org/support/users/emt036/)
 * (@emt036)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198212)
 * If you do a search on these forums, there are a number of threads on “Error 12.”
 * Basically, you need to call your host and have them sort out the MySQL server.
 * Some users have reported success by using “Repair Tables” in PHPMyAdmin.
 *  [hooopla](https://wordpress.org/support/users/hooopla/)
 * (@hooopla)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198643)
 * My site and others on my host continue to get these errors intermittently:
 * `WordPress database error: [Got error 12 from storage engine]
    SELECT DISTINCT
   YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM wp_posts
   WHERE post_date < '2005-05-04 00:09:12' AND post_status = 'publish' GROUP BY 
   YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC
 * We’ve discussed this with our admins and, in their opinion, itâ€™s because “WP
   needs to optimize GROUP queries on multi-year posts”. This is an issue that they
   have already pointed out to Matt.
 * I have a lot of confidence in my hosting provider and don’t believe our servers
   or configuration are at fault. I’d really appreciate some feedback from the WP
   developers about these errors.
 *  [skippy](https://wordpress.org/support/users/skippy/)
 * (@skippy)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198645)
 * It’s not a matter of anyone being ‘at fault’. It’s not necessarily a poor configuration
   from your server, nor is it necessarily poor coding from WordPress.
 * The server is running out of free RAM. There are lots of solutions to this problem.
   Obviously, more RAM (or less customers) for the server is one. Another would 
   be to possibly trim templates / themes to reduce the kinds of queries listed 
   above (looks like a yearly archive view, which could conceivably generate a LOT
   of data).
 *  [hooopla](https://wordpress.org/support/users/hooopla/)
 * (@hooopla)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198650)
 * Sorry, I didn’t mean to point the finger. I realize there are a lot of factors
   at play here.
 * Now, the error is not from a yearly archive view — it occurs right on my front
   page. My [site](http://cuppanews.com) is barebones in terms of themes/templates.
   I don’t even use comments or trackbacks. The server on which it’s hosted is new
   and not overloaded with accounts. (When I said that I have a lot of confidence
   in my host, it’s because everything they do is aimed at providing the best possible
   platform.)
 * This error doesn’t happen a lot and it’s not reproducible in any practical way.
   But it does happen and it’s frustrating.
 *  [hooopla](https://wordpress.org/support/users/hooopla/)
 * (@hooopla)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198651)
 * _Now, the error is not from a yearly archive view — it occurs right on my front
   page._
 * Actually, I take that back. It _is_ happening on my front page, but my front 
   page displays all posts — so, yes, I guess it is a yearly archive view.
 * I’ll work on limiting it to the last couple of weeks and see if that helps.
 *  [Aine](https://wordpress.org/support/users/aine/)
 * (@aine)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198746)
 * Right after upgrading to 1.5.1.1 I got Error 12:
 * WordPress database error: [Got error 12 from storage engine]
    ALTER TABLE `wp_posts`
   ADD INDEX ( `post_name` )
 * WordPress database error: [Got error 12 from storage engine]
    ALTER TABLE `wp_posts`
   ADD INDEX ( `post_status` ) Step 1
 * There’s actually only one step. So if you see this, you’re done. Have fun!
 * Even after repairing tables and optimizing tables. Same error when running upgrade.
   php
 * WP seems to be running fine, though. And if it’s a memory error on the server,
   that’s my host’s fault. I’ll tell them.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198747)
 * [http://wordpress.org/support/search.php?q=Got+error+12](http://wordpress.org/support/search.php?q=Got+error+12)
 * [http://www.google.com/custom?domains=wordpress.org&sitesearch=wordpress.org&q=Got+error+12&sa=Go&ie=UTF-8&oe=UTF-8&hl=en](http://www.google.com/custom?domains=wordpress.org&sitesearch=wordpress.org&q=Got+error+12&sa=Go&ie=UTF-8&oe=UTF-8&hl=en)
 *  [Aine](https://wordpress.org/support/users/aine/)
 * (@aine)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198748)
 * Yes, macmanx, that’s how I found this thread.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198749)
 * Congratulations. My apologies for doing what I thought might be helpful. I won’t
   do it again.
 *  [Aine](https://wordpress.org/support/users/aine/)
 * (@aine)
 * [21 years ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198750)
 * [http://forum.textdrive.com/viewtopic.php?pid=33317#p33317](http://forum.textdrive.com/viewtopic.php?pid=33317#p33317)
 * Apparently, the upgrade.php uses a bit of memory.
 *  [solstice](https://wordpress.org/support/users/solstice/)
 * (@solstice)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198802)
 * I encountered this bug on an airline site we wrote and maintain. The site is 
   served from a few machines and a load balancer, we have no appreciable memory
   issues. As such, I think we can agree it is not a memory problem.
 * Upgrading from mysql v4.1.10a to v4.1.13 has solved this issue for us. I am fairly
   certain it is a mysql bug.
 * As a point of interest, the less you listen to your hosting company about technical
   issues, the better. They will lie through their teeth to blame their problems
   on anything but themselves.
 * HTH
 *  [bonniparker](https://wordpress.org/support/users/bonniparker/)
 * (@bonniparker)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198855)
 * I was having the same issue. When I did repair tables, that solved the problem.
   Thanks so much!! =D

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘WordPress database error: [Got error 12 from storage engine]’ is closed
to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 8 participants
 * Last reply from: [bonniparker](https://wordpress.org/support/users/bonniparker/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/wordpress-database-error-got-error-12-from-storage-engine/#post-198855)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
