[mythtv-users] What might make the backend loose the database connection to localhost?

Dan Wilga mythtv-users2 at dwilga-linux1.amherst.edu
Wed Oct 27 13:34:26 UTC 2010


On 10/26/10 3:06 PM, Tom Dexter wrote:
> On Tue, Oct 26, 2010 at 10:11 AM, Dan Wilga
> <mythtv-users2 at dwilga-linux1.amherst.edu>  wrote:
>    
>> On 10/26/10 8:04 AM, Tom Dexter wrote:
>>      
>>> Last night I had an odd thing happen.  In the middle of recording
>>> apparently the backend lost it's connection to the database (running
>>> on the same server connected as localhost), and all the sql started
>>> generating errors like this:
>>>
>>> 2010-10-25 21:00:03.357 DB Error (Resolution insert):
>>> Query was:
>>> INSERT INTO recordedmarkup    (chanid, starttime, mark, type, data)
>>> VALUES ( :CHANID, :STARTTIME,
>>>   :MARK, :TYPE, :DATA);
>>> Bindings were:
>>> :CHANID=1041, :DATA=1920, :MARK=1, :STARTTIME=2010-10-25T21:00:00,
>>> :TYPE=30
>>> Driver error was [2/2006]:
>>> QMYSQL: Unable to execute query
>>> Database error was:
>>> MySQL server has gone away
>>>
>>>        
>> That last line is what you should google. It sounds as though MySQL hit its
>> connection timeout and dropped the connection at a point when Myth wasn't
>> expecting that to happen.
>>
>> The solution is most likely to look at wait_timeout and interactive_timeout
>> MyQSL variables. These are in seconds. If there are values set in
>> /etc/my.cnf, increase them. The defaults are very large (8 hours), so if
>> nothing is set, that's not the problem. You can do this to see the current
>> values:
>>
>> mysql -u mythtv --password=mythtv
>> show variables like '%timeout';
>> \q
> That's definitely not it I'd say.  Those are both at the defaults of
> 28800.  Besides, mysql was anything but idle at the time as I was
> about an hour 15 minutes into very heavy recording when it happened
> (three shows recording).  It just flat out lost the
> connection...really odd.
>    
I noticed that the error you reported was right at the top of the hour. 
Is there any chance that something like logrotate caused mysqld to 
restart? You might look in the mysqld.log (often in /var/log) to see 
when it last did.

-- 
Dan Wilga                                                        "Ook."



More information about the mythtv-users mailing list