Jump to content

MySQL server has gone away + Error reading result set's header


Dario

Recommended Posts

Hello. I'm using PS 1.7.2.4. When I go to the payment methods or to the shipping page it takes at least 2 minutes to load and then I get these errors:

Warning alla linea 134 nel file /home/liggia5/public_html/classes/db/DbPDO.php
[2] PDO::query(): MySQL server has gone away

Warning alla linea 134 nel file /home/liggia5/public_html/classes/db/DbPDO.php
[2] PDO::query(): Error reading result set's header
 

It was working fine yesterday, I don't know what may have caused this. I've already tried to disable some modules but nothing changes. Anyone can help me please?

P.S. It only happens with these two pages, everything else is ok

Edited by Dario (see edit history)
Link to comment
Share on other sites

On 12/3/2018 at 10:44 AM, Simonas Invertus said:

For some reason your database crashes. First you need to restart your database when you can investigate what happens. 

Hello, thank you for your answer. How can I restart the database? I contacted the support center of inmotionhosting and they told me that the database is working fine. What can I do?

Link to comment
Share on other sites

51 minutes ago, Simonas Invertus said:

Do you know what changed?

I mean: did you install new modules or new theme?

Maybe your hosting provider updated PHP version or database? 

I think a few modules have been upgraded. I tried to disable someof them especially the new ones but the problem is still there.

Link to comment
Share on other sites

15 minutes ago, Simonas Invertus said:

Can you make a copy of your shop in the different environment? Test if it has the same issues. If no, it means something wrong with server configuration.

If yes, try to delete one by one modules and test every time if it starts working. If it starts working when some module was corrupt. 

Do you mean like copying the shop on local server with xamp? I will also try to unistall the modules like you said

Link to comment
Share on other sites

  • 6 months later...
  • 2 years later...

Hola

 

Lo que yo realice fue validar los procesos en mi base de datos ya que se me estaban encolando muchos procesos dormidos, para esto use el siguiente comando:

 

SHOW FULL PROCESSLIST

 

Con eso liste todos los procesos que se estaban ejecutando y fui eliminando los procesos Sleep que tenía mediante el comando:

 

KILL 1284303;

 

El 1284303 es el ID del proceso dormido; de esta forma logré solucionar la novedad presentada con el PDO::query(): Error reading result set's header……

 

 

Como complemento:

 

Me gusta la programación entonces genere un archivo php en la raíz de mi sitio para poder eliminar esos procesos dormidos, lo comparto por si a alguien le interesa, es básico pero funcional y cada uno lo puede modificar de acuerdo a sus necesidades:

 

<?php

         include(dirname(__FILE__) . '/config/config.inc.php');

        $_sql = "SHOW FULL PROCESSLIST";

       $_processList = Db::getInstance()->executeS($_sql);

       for ($i=0; $i < count($_processList); $i++) {

            if ($_processList[$i]['db'] == 'nombre_de_mi_base_de_datos' && $_processList[$i]['Command'] == 'Sleep' && $_processList[$i]['Time'] > 200) {

                $_sql = "KILL ".$_processList[$i]['Id'];

                Db::getInstance()->execute($_sql);

           }

      }

?>

 

 

Cordial saludo.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...