WordPress.org

Ready to get started?Download WordPress

Forums

Database Error when Publishing Posts (16 posts)

  1. MCRebbe
    Member
    Posted 8 years ago #

    Following a mildly traumatic move to a new server, I now have my sites back up and running.

    When I post to http://www.thetechnofile.com the post appears as per normal in the blog, but part way through publishing, I get the following error message:

    WordPress database error: [Lost connection to MySQL server during query]
    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) VALUES ('159','_pingme','1')

    Warning: Cannot modify header information - headers already sent by (output started at /home/myaccount/public_html/thetechnofile/wp-includes/wp-db.php:102) in /home/myaccount/public_html/thetechnofile/wp-admin/post.php on line 127

    The same thing happens when editing an existing post.

    I'm running WP 2.0.2

    Help please.

    Cheers,

    MC

  2. Samuel B
    moderator
    Posted 8 years ago #

    Try putting:

    headers already sent

    in the search box. You might be amazed.

  3. MCRebbe
    Member
    Posted 8 years ago #

    I was not.

    Perhaps someone has something constructive to add?

  4. Mark (podz)
    Support Maven
    Posted 8 years ago #

    "Lost connection to MySQL server during query"
    is a hosting issue. For some reason the comunication between your side of things and the database is going wrong.
    I'd have a chat to your support - WP would not do this.

  5. MCRebbe
    Member
    Posted 8 years ago #

    Thank for that Podz. I'll get onto them

    MC

  6. MCRebbe
    Member
    Posted 8 years ago #

    OK, so I've spoken to my hosts and tried various things:

    I did a clean installation of WP 2.0.2 (using Fantastico) in a sub domian and editing/publishing posts worked perfectly...until I imported my existing database, after which I got exactly the same error again. We tried repairing the database and still get the same problem.

    My hosts suggest this means it is neither WordPress nor a hosting issue, but a database issue.

    HOWEVER, when I remove my largeish list of pings (or just try with a couple of pings) the problem disapears. Which makes me think that what is happening is that WordPress is timing out whilst trying to ping my long list?

    The only possibly illogical thing about that thought, is that with the clean fantastico install (before the databse was restored), WordPress would hapilly ping everything on the long list.

    Searching the Fora, I did find this plug-in http://somethingunpredictable.com/wp-no-ping-wait/
    Which seems to solve the problem (which would appear to support the idea that WP is timing out).

    However, I'm not convinced that any pinging is actually happening with that plug in activated, as pings don't seem to show up on Technorati or elswehere, so I'm wondering if all it is actually doing with WP 2.0.2 is to switch off the pings, which is how it is solving the problem?

    My hosting company have suggested batting it back to the WP fora, so does anyone have any comments/suggestions?

    BTW it is not, as far as I can tell, a whitespace issue. I have doublechecked and reuploaded both files mentioned in the error message as well as the wp_config.php and it makes absolutely no difference whatsoever. I still get the same error messages.

    It has been suggested the database may be corrupted in some way. If that's the case it means doing a clean install and manually copying everything across, which I'd rather avoid.

    On the other hand, if the DB has been compromised, I don't want to use a quick fix like the plug in above or reducing my ping list, only to find somewhere down the line that I have to recreate the databse manually...by which time I may have added a couple of hundred more posts.

    Help please!

    Cheers,

    MC

  7. MCRebbe
    Member
    Posted 8 years ago #

    Update:

    I have dramatically reduced the size of my pings list on http://www.mcrebbe.com by replacing it with list #2 suggested here:

    http://www.instant-info-online.com/wordpress-compressed-all-inclusive-ping-list.html

    I am still having the same problem regardless.

    Help!

  8. Samuel B
    moderator
    Posted 8 years ago #

    http://wordpress.org/support/topic/54451?replies=4

    Still sounds like a whitespace issue. Sorry if you don't think that's constructive.

  9. MCRebbe
    Member
    Posted 8 years ago #

    Sorry Samboll. I misunderstood your original response. My bad. You were being constructive.

    However, I did check for whitespace in the files mentioned in the erro message + wp_config.php and the problem still persists.

    I also did a clean install, which worked perfectly until I imported my original database into it, at which point the problem replicated.

    ???

    MC

  10. Samuel B
    moderator
    Posted 8 years ago #

    Maybe you should post the code for both files at
    http://paste.uni.cc
    and some of us can have a look. Maybe you're too close to problem and frustrated? :>)
    Be sure and x out pertinent info in config file (username, password, etc.).

  11. Mark (podz)
    Support Maven
    Posted 8 years ago #

    MCRebbe - try:
    - removing all pinging for a day or so
    - deactivate plugins.
    If you can deactivate them all and this does continue at least we know it's nothing to do with them.
    If it does not continue then we have a guilty plugin.

    I think it's the pinging.
    I think the blog is waiting so long for a reply that somewhere a process finishes - and throws that error at you.

    ["Warning: Cannot modify header information - headers already sent by (output started at /home/myaccount/public_html/thetechnofile/wp-includes/wp-db.php:102)"
    such errors between internal files are usually caused by code in those files. Quite why they throw a 'headers already sent' is beyond me as core files very very rarely have a whitespace problem]

  12. MCRebbe
    Member
    Posted 8 years ago #

    Thanks Podz.

    I already tried all of the above a couple of days ago:

    - The problem happens regardless of whether or not plug ins are activated.

    -The problem only happens when pinging. If pings are removed from the options/writing tab, the problem does not happen, with or without plug ins activated/deactivated.

    - Nevertheless I have tried this all again, with exactly the same results.

    - The exception is the 'No Ping Wait' plug in, which I started experimenting with a couple of days ago. When it is activated, the problem disapears.

    BTW: None of this was a problem on the old server, though thinking about it, I was running versions 1.5.2 (mcrebbe) & 2.0 (thetechnofile) on that server. I did upgrade both blogs to 2.0.2 on the old server (and everything seemed fine) before moving to the new one, but I didn't actually post anything on the old server after that upgrade.

    - I thought it was the pinging too. However, I did a clean install of WP 2.0.2 on the new server (using fantastico), added the original very long list of pings to the options page, did a test posting and everything worked perfectly...then I imported my wordpress database and the problem appeared again?

  13. pauljohns
    Member
    Posted 8 years ago #

    Try what is suggested in this thread -
    http://wordpress.org/support/topic/47354

    It solved my issue. It's whitespace in the wp-blog-header.php file... maybe.

  14. stchatterbox
    Member
    Posted 8 years ago #

    The same problem happens after I upgraded to WP 2.0.2. I was about to post my problem here and now founded this long thread. Perhaps I'll try Paul Johns' solution by cleaning those white spaces.

  15. MCRebbe
    Member
    Posted 8 years ago #

    Paul,

    Thanks, but I tried what was in that thread ages ago - it solved nothing. As I & others have already said above, it's not a whitespace issue.

  16. pauljohns
    Member
    Posted 8 years ago #

    Darn, sorry to hear that. :(
    If I find anything useful, I'll post again.

Topic Closed

This topic has been closed to new replies.

About this Topic