On Mon, 2 Feb 2004, Jeff Holt wrote:

> It means that the mysql daemon terminated after you "connected" to it.
> It's possible that the daemon was restarted. Therefore, it might be wise
> to set up an "exception" handler for this error. Maybe one or two
> consecutive reconnect attempts would be in order.
>
> By the way, this is an error specific to MySQL. You can find error codes
> documented at www.mysql.com.
> -----Original Message-----
> From: Daniel R. Anderson [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 02, 2004 13:40
> To: [EMAIL PROTECTED]
> Subject: MySQL Database has gone away
>
> I'm running a script on a fresh installation of Slackware, that worked
> fine on my old Mandrake box, but I keep getting all these errors that
> say:
>
> DBD::mysql::st execute failed: MySQL server has gone away at
>
> What does this mean and how do I fix it?
>
> Thanks in advance,

I found the same problem with a script that connected to the MySQL
data base before issuing an  open FH,"-|"  and found that I got the
above error.  The script had been working and the only change had been
to put in the implicit fork.

An examination of the logic showed that there was no need to have the
data base open while reading the output of the pipe, so I moved the
connect to after the close on the file handle.  The problem went away
and things were working again.

I assumed that the clean up routines for the child process were
cleaning up the MySQL connection in the parent process as well.  I'm
not sure what I will do if I need to run such pipes between the
connect and the disconnect.  I guess, based on Jeff's suggestion that
I will have to re-connect to the data base after running such pipes.

--
      /"\                            O-  J. Anthony Fitzgerald      -O
      \ /    ASCII Ribbon Campaign   O-  [EMAIL PROTECTED]                 -O
       X     Against HTML Mail       O-  http://people.unb.ca/~jaf  -O
      / \                            O-  Fredericton, NB, Canada    -O

Reply via email to