Re: Handling death of mysqld

From: Luuk <luuk_at_invalid.lan>
Date: Tue, 23 Jan 2018 22:08:23 +0100
Message-ID: <5a67a443$0$9995$e4fe514c_at_news.xs4all.nl>


On 23-01-18 22:01, The Natural Philosopher wrote:
>
> This one caught mne out during a routine upograde of the mysql server -
> the server was killed and restarted.
>
>
> One of my programs failed to handle this gracefully:  It is a piped
> program that takes log data from apache and injects it into the database
> for traffic and usage analysis.
>
> It is very simple. It opens the databsae, never closes it, and executes
> insert/update on duplicate statements several times a second typically.
>
> Obviously at some point these failed, but I would have assumed that the
> underlying C libraries would reconnect to the server once it came up,
> and these inserts would resume. It semmes not
>
> I had to restart the apache server to respean the pipe and re open thet
> database.
>
> What error does mysql_query() return in such a case, so I know that its
> happened and can go into 'sleep, and reconnect' mode?
>
>
>
>

The error that mysql_query() returns, on a failed (or closed) connection should be in your error log.... Received on Tue Jan 23 2018 - 22:08:23 CET

Original text of this message