Support » Fixing WordPress » WordPress database error Lost connection to MySQL server during query

  • My blog is “mostly” working after a recent move to a new hosting provider. I’ve been using/customizing WordPress for 2 years so I am fairly familiar with self-hosted configuration/setup/troubleshooting but am running into a strange database-oriented problem. The site is running slower than it should be. I have moved/started about 10 blogs on this new hosting provider (Media Temple) and all are fine and have been running well for months, but this recently-moved blog is seeing lost connection problems. Some pages show on the blog, others timeout due to the DB issue.

    All my blogs are on the same grid, in the same SQL Server container, so I know it isn’t a SQL Server issue since all the other blogs are fast and no errors.

    This isn’t the only query that has problems but is an example:

    WordPress database error Lost connection to MySQL server during query for query SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM wp_posts WHERE post_type = ‘post’ AND post_status = ‘publish’ GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC made by require, require_once, include, get_header, locate_template, load_template, require_once, wp_get_archives ….

    This is my most important blog, so any help or suggestions is greatly appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)
  • have you run a “repair” or “optimize” on your mysql tables?
    one of them is likely crashing

    Thank you samboll for responding.

    I have done both and neither have resulted in an improvement. I have done repair and optimize on all tables.

    There seems to be an issue with new posts since the move.

    If I add one, I can see it on the home page but when I click on the title to go to the single page, that’s when the db issues arise.

    I end up deleting the new post and everything is fine.

    Problem is, it’s a blog. I need to create new posts…

    might try resetting permalinks
    admin – settings – permalinks

    Resaved permalinks, created new post and no good. I’m getting desperate here. No posts in 5 days. Thanks Samuel. More ideas?

    unless someone comes up with something else, it still looks like a db error to me.

    I suppose if it were my site I would do a db backup (or 2) and create a new db or at least a new $table_prefix – re -install 2.7 and import the db

    I had already created an entirely new db, did an import of the sql file and changed the wp-config to hit the new db. same issues. I’m stumped. I may rebuild from scratch on the html/ side too.

    I found a plugin that I wrote was causing the issue. I would have never guessed since the “long queries” in Mysql were core WP and not mine, which threw me off. Thanks for your help.

    Which plugin was it? I’m having the exact same issue.

    It would be handy to know which plugin, since I too am having this issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WordPress database error Lost connection to MySQL server during query’ is closed to new replies.