Handling death of mysqld

From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Tue, 23 Jan 2018 21:01:24 +0000
Message-ID: <p487r5$gjt$1_at_dont-email.me>


[Quoted] [Quoted] This one caught mne out during a routine upograde of the mysql server - [Quoted] the server was killed and restarted.

[Quoted] 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.

[Quoted] 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, [Quoted] and these inserts would resume. It semmes not

I had to restart the apache server to respean the pipe and re open thet database.

[Quoted] What error does mysql_query() return in such a case, so I know that its happened and can go into 'sleep, and reconnect' mode?

-- 
Religion is regarded by the common people as true, by the wise as 
foolish, and by the rulers as useful.

(Seneca the Younger, 65 AD)
Received on Tue Jan 23 2018 - 22:01:24 CET

Original text of this message