Re: Handling death of mysqld

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Tue, 23 Jan 2018 21:15:17 +0000
Message-ID: <p488l6$mhh$1_at_dont-email.me>


On 23/01/18 21:08, Luuk wrote:

> 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....
> 

What error log would that be Luuk? The one that the server that has been shut down is writing to?

Do I use a call to Mysql_Ouija() to read it?

:-)

-- 
Gun Control: The law that ensures that only criminals have guns.
Received on Tue Jan 23 2018 - 22:15:17 CET

Original text of this message