• I have encountered this error several times in the last 5 months on GoDaddy servers. Each time, GoDaddy has blamed WordPress.

    https://totalphysiqueonline.com/ was working just fine with 2.04-2.07 with the exception of the 3, now 4, [MySQL server has gone away] instances.

    Why is GoDaddy telling me the problem is with the template or with WordPress?

Viewing 15 replies - 16 through 30 (of 39 total)
  • Well, they did see the error. And they did look into it. And this is what I just got from them:

    “The error that you are receiving indicates that your MySQL Queries are taking an excessive amount of time and are timing out. We are not able to assist you in resolving this issue as this is a coding issue.”

    A coding issue? All of a sudden? I haven’t changed anything. Why would my queries suddenly be taking longer?

    Can someone knowledgeable about the inner workings of WordPress please step in here and explain why my queries should suddenly start taking longer?

    Thread Starter 4evrblu

    (@4evrblu)

    Well, this is exactly what I ran into. If WordPress is so bad, then why do they make it available?

    Moreover, if this is merely a coding issue, then why did my site work sometimes, and sometimes not work? Makes no sense.

    What has changed are Go Daddy Database servers.

    I am at Host Gator now, and I have been posting and editing my site all day and not once have I run into a single issue.

    Go Daddy sucks.

    So far Host Gator rocks.

    I don’t think that it is a GoDaddy problem. I have GoDaddy as my host. For me, the only problem I have had with this was on the Dashboard. It only happened in those sections that import outside data. To fix it, I simply edited the index file in the wp-admin folder so that it no longer called the bottom feed. Ever since it has yet to happen again.

    hi,

    the problem isn’t on the host
    it’s more due to the problem of mysql server.

    if you refer to https://www.vbulletin.com/forum/showthread.php?t=43505

    it shows that mysql might time out on your connection.
    especially when mysql_connect in php actually reuse your old connection when calling mysql_connection (which is alike ms$ connection pooling )

    so, my suggested solution is to set the 4th parameter of mysql_connection to true, to makesure php does not reuse existing connection.
    and then do a ping to the server.

    mysql_ping

    do the ping on query function, right before query is done.

    For my modified file:

    https://www.openadvent.com/blog/?p=30

    Thread Starter 4evrblu

    (@4evrblu)

    This is a great reply. I bet this is what would have fixed my problem and everyone else. I wish i had found the solution before making the switch! Hmmm.

    Oddly enough though, if this is how simple the fix is, why doesn’t Go Daddy know this? The problem seems very common. Seems to me that this is what Go Daddy database techs would want to know.

    ::)

    Thread Starter 4evrblu

    (@4evrblu)

    Duplicate post deleted

    @openadvent: I am not too good at this yet so just want to confirm I understand. To avoid this issue, just insert the following and then set the line after the dashes below to have >dbpassword, “true”); These are the only changes needed to fix?

    Thanks!

    $this->dbuser = $dbuser;
    $this->dbpassword = $dbpassword;
    $this->dbname = $dbname;
    $this->dbhost = $dbhost;

    $this->connecttodb();
    }

    function connecttodb()
    {
    ————————————–

    $this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);

    hi 4evrblu,
    hope it helps ??

    WT,

    you need to copy the function checkconnection()
    as well.

    and also alter your query function to call checkconnection before query:

    function query($query) {
    // filter the query, if filters are available
    // NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method

    $this->checkconnection();


    https://www.openadvent.com/blog/?p=30#more-30

    at first I thought that mine was doing because it was erroring out when trying to load the sections that involved outside data. I was wrong… it eventually happened to me as with everyone else. This fix seems to have worked. Thank you…

    Has anyone entered this in as a bug?

    Joining in on the thread a bit late…I’m having the same trouble on my WP website when trying to work in Admin. Saving posts, managing comments, deleting spam all result in this error. I’m not familiar with the intimate workings of MySQL, but I do know how to login to MySQL and backup my database, so if someone could point me in the right direction on how to execute this fix, I would greatly appreciate it. I’m pretty sure it’s the time out issue as mentioned by openadvent, and I just need to understand how to find the things that need modification.

    That’s a good fix, although it still takes a long time to edit and upload posts.

    arm0110, just follow the link to openadvert’s blog, then download the php file and replace your own file. wp-includes/wp-db.php.

    It’s not a bug, at least on WordPress’s end. I run two blogs, one using WordPress version 2.0.5 and the other using 2.1.3.

    Both blogs were affected at the same time. Both blogs are hosted by GoDaddy, but on different hosting plans and therefore using different MySQL databases.

    One database is version 4.0, the other is version 5.0.

    It looks to me like it’s GoDaddy’s fault completely.

    Thank you openadvent! Just came back to this after getting distracted for a couple of weeks. My site was generating the infamous “gone away” message when anyone used the contact form. After clicking “send”, indeed it took 10 seconds or so to send it. This caused the error message. I just downloaded your php file and replaced mine and the error no longer is popping up. The form still takes 10 or 15 seconds to send, but the error is gone.

    Now, if there was only such an easy solution to the common error where new users do not get their initial sign-up or “forgot password” emails.

    Can anyone say if this fix is 2.0.9 compatible?

    I had a similar issue with GoDaddy. I migrated the database from 4.1 to 5.0 and the MySQL errors, specifically the “gone away” message disappeared. However, any page may or may not load completely blank at any time, and caching has been turned off.

    The site in development:

    https://test.common-mound.com

    Based on the excellent work of openadvent, I created a fixed version of wp-db.php for WordPress 2.2.1, which you may download from here:

    https://robsnotebook.com/wordpress-mysql-gone-away

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘WordPress database error: [MySQL server has gone away]’ is closed to new replies.