Ready to get started?Download WordPress


WordPress database error (9 posts)

  1. Doodlebee
    Posted 6 years ago #

    The error message:

    WordPress database error: [Out of memory; restart server and try again (needed 65528 bytes)]

    Just getting that out of the way :)

    I just reformatted my hard drive yesterday. Spent all day (yesterday and today) backing stuff up and formatting, loading everything - ugh. I saved my XAMPP installation files, my localhost WP databases and files. Everything's up and running nicely, but I started working on a site and when I did a search on the test server, I got that error above. Happens *only* when I use the "search".

    Now, I'm sure it's a setting somewhere (or, pretty sure, anyway), and it's only a localhost issue, and it *must* have something to do with the fact that I just formatted my hard drive (because I didn't have this problem *before* I wiped the slate clean) - would anyone know what it might be? At first I thought it was my PHP reaching some kind of memory limit, but it's set at 16M, and I tried to increase the limit to 20, and it had no effect (yes, I restarted Apache and MySQL).

    Another *possible* problem (although I'm not too convinced of this, because - as I said before - I didn't have this issue before I wiped the hard drive) is that I've written a custom plugin that re-creates the "list pages" function in WP. It connects to the database and looks for Pages that have a certain custom field entry, then outputs those pages in order by ID. (But I also needed *one* category inserted in the middle of the list of pages, to I put in a conditional to add that in, as well.) So it's a tricky piece of code, but I've read here that custom plugins such as this might cause some issues. (This sidebar is used sitewide.)

    As an aside - does anyone think that this is something the devs might be interested in seeing? Maybe for an upcoming release? I dunno - just thought I'd ask.

    Anyway, I read another post on the forum here that such a plugin might leave some "open ends" and too many database queries, and it's possible that it could be causing the error. But I'm not totally convinced of it - so if anyone would like to see that code, I can provide a link to the text file, if you really think that's a possibility.

    Anyway - anyone have any ideas of what I could do? I don't really care so much for *my* server, but when it goes live, I want to know that this error won't happen.

  2. whooami
    Posted 6 years ago #

    does anyone think that this is something the devs might be interested in seeing?

    One of my plugins, wp-chunk, is all of 10 or so lines of actual code, and just received it's 60th pingback today. If it were moved into the core it would amount to about 4 changed lines.

    It's not in the core, nor has it ever been considered, that I am aware of.

    What does that tell you?

    Plugins are just that, plugins.


    As for the error you are seeing, I'm guessing thats exactly what it says, a memory issue. Try that while you have the task manager open and see if you're seeing memory issues there as well.

    Incidentally, how much ram does that box have?

  3. Doodlebee
    Posted 6 years ago #

    Try that while you have the task manager open and see if you're seeing memory issues there as well.

    Wow - every time I search, it hops up to 99% of my CPU usage. How *weird*! Now why would it do that?

    (and thanks for the plugin tip - maybe someday, then, I'll figure out how to "wordpress" it - when I have time!)

  4. whooami
    Posted 6 years ago #

    I'm guessing that windows would prefer you doing a MySQL full text search instead of the typical LIKE %blah% searches that WP uses.

    How many tables are you searching, do you know?

  5. Doodlebee
    Posted 6 years ago #

    How many tables are you searching, do you know?

    [deleted a bunch of dumb stuff because I *just* realized you were asking about the plugin LOL]

    It's only searching 3: wp_options, wp_posts and wp_postmeta. I'll give you the start of it - the stuff after where I stop is just the output:

    $default_sort = 'ID';
    $allowed_order = array ('ID', 'page_id', 'post_title');
    if (!isset ($_GET['order']) ||
        !in_array ($_GET['order'], $allowed_order)) {
        $order = $default_sort;
    } else {
        $order = $_GET['order'];
    $query = "SELECT * FROM wp2_options, wp2_posts, wp2_postmeta where wp2_options.option_name = 'siteurl' AND wp2_postmeta.meta_key = 'main_nav_description' AND post_id = wp2_posts.ID ORDER by $order";
    $result = mysql_query ($query) or die(mysql_error());

    Like I said, everything after this is pretty much output. There's a conditional in there to look for a certain page so it can insert some other stuff - but it's hard-coded output, not queried. And I'm sure there's probably a more non-MySQL-pro-WP way to write the code, but I didn't feel like trying to figure it out ;)

    Anyway, I'm suspecting an issue with my setup right now, because before, I had a password set for my phpMyAdmin area, but after the format it won't accept *any* password. I had to remove it completely, and now I log in with no password at all - which is odd to me, but since it's not open to anyone but me, I didn't see it as a big deal. I'm wondering if that might have something to do with it (not necessarily the password itself, but the issue that's causing it to not recognize the password).

    I must go to bed right now (way late here), but I'll check back in the morning, in case you (or anyone else) reply. If not, I figure I'll just do a fresh download/installation of XAMPP and see if I can't reconfigure the thing tomorrow - I've had to do that with a few programs, actually. (Formatting is FUN!)

  6. whooami
    Posted 6 years ago #

    actually i was asking about the search thats causing the memory issue :)

    formatting sucks :O

  7. Doodlebee
    Posted 6 years ago #

    oh - great, so I deleted all that for nothing! LOL

    If you mean the search *term* it's just stupid little words like "Boo". But the search itself - I would imagine - is only searching the tables for the WP install I'm specifying. I have 3 WP installations on one database - so I would hope it's not trying to search all three installations (if it were, that would be 34 tables).

  8. heartless
    Posted 6 years ago #

    I'm getting this exact same error, only it occurs when I click the Comment RSS Feed link.

    WordPress database error: [Out of memory; restart server and try again (needed 65528 bytes)]

    I deactivated all of the plugins and I still had the same issue so I backed up the data base and did a complete re-install of wordpress 2.2 The comment RSS worked. I reinstalled my theme, then I restored the data base. As soon as I restored the data base, the problem reappeared. It seems like it has to do with my posts, but that couldn't be could it? I am tearing my hair out over this.

    please help

  9. aresstokrat
    Posted 6 years ago #

    I FIXED THIS. You have to modify your
    MySQL my.cnf file like this:

    key_buffer = 128K
    max_allowed_packet = 16M
    table_cache = 4
    sort_buffer_size = 128K
    read_buffer_size = 128K
    read_rnd_buffer_size = 128K
    net_buffer_length = 128K
    thread_stack = 128K

    if you use virtual hosting try to write to your hoster.

Topic Closed

This topic has been closed to new replies.

About this Topic