WordPress.org

Ready to get started?Download WordPress

Forums

SQL errors in WordPress Error Log (3 posts)

  1. kp2575
    Member
    Posted 5 years ago #

    I have been having a lot of issues with my wordpress install logging me out. I checked the error log in wordpress to see this. Wondering if I could get a little help on breaking this down.

    [10-Apr-2009 10:56:00] WordPress database error MySQL server has gone away for query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1=1 AND wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN ('14') AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 1 made by require, require_once, include, query_posts, WP_Query->query, WP_Query->get_posts
    [10-Apr-2009 10:56:00] WordPress database error MySQL server has gone away for query SELECT FOUND_ROWS() made by require, require_once, include, query_posts, WP_Query->query, WP_Query->get_posts
    [10-Apr-2009 10:56:00] WordPress database error MySQL server has gone away for query SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.term_id = '14' LIMIT 1 made by require, require_once, include, get_category_link, get_category, get_term
    [10-Apr-2009 10:56:00] WordPress database error MySQL server has gone away for query SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = 'category' AND t.term_id = '14' LIMIT 1 made by require, require_once, include, single_cat_title, get_the_category_by_ID, get_category, get_term

  2. iridiax
    Member
    Posted 5 years ago #

    MySQL server has gone away

    Contact your web host.

  3. Shane G
    Member
    Posted 5 years ago #

    Hi,

    The most common causes are:

    1. The server timed out and closed the connection. By default, the server closes the connection after 8 hours or 28800 seconds if nothing has happened. You can change the time limit by setting the wait_timeout variable when you start mysqld via your server's /etc/my.cnf (on Linux; locate the file in installation directory on windows) as well. This mostly affects persistent connections; connections opened using mysql_pconnect() in PHP. It can also affect pooled connections from say any server side connection pooling.

    2. Another common reason to receive the MySQL server has gone away error is because you have issued a "close" on your MySQL connection and then tried to run a query on the closed connection. This is a simple logic problem. Are you sharing the connection across multiple threads?

    3. You got a timeout from the TCP/IP connection on the client side. This may happen if you have been using the commands: mysql_options(…, MYSQL_OPT_READ_TIMEOUT,…) or mysql_options(…, MYSQL_OPT_WRITE_TIMEOUT,…). In this case increasing the timeout, as described above, may help solve the problem.

    4. You have encountered a timeout on the server side and the automatic reconnection in the client is disabled. Please refer to the article linked above for details and solution.

    5. You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld receives a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by setting the server's max_allowed_packet variable, which has a default value of 1MB. You may also need to increase the maximum packet size on the client end. More information on setting the packet size is given in Section B.1.2.9, “Packet too large”.

    6. An INSERT or REPLACE statement that inserts a great many rows can also cause these sorts of errors. Either one of these statements sends a single request to the server irrespective of the number of rows to be inserted; thus, you can often avoid the error by reducing the number of rows sent per INSERT or REPLACE.

    7. You also get a lost connection if you are sending a packet 16MB or larger if your client is older than 4.0.8 and your server is 4.0.8 and above, or the other way around.

    Thanks,

    Shane G.

Topic Closed

This topic has been closed to new replies.

About this Topic