List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:June 17 1999 11:09am
Subject:Re: Aborted connection ... to db
View as plain text  
Max Chernykh wrote:
> 
> Hi,
> Sorry for my English, but I hope you understand me...
> 
> I have a scripts, which use :
> -------------------------------------------------------------------
> #!/usr/bin/perl
> 
> use DBD::mysql;
> $host="";
> $database="DBI:mysql:zavalinka";
> 
> $dbh = DBI->connect($database,"wwwsrv","") ||
>         print "cannot connect to mysql at $host:$database\n";
> 
> $time = time-30;
> $dbh->do("delete from contact where atime<$time");
> 
> $time = time-86400;
> $dbh->do("delete from blacklist where atime<$time");
> 
> $dbh->disconnect;
> --------------------------------------------------------------------
> 
> Script work some time and there is time when it will break... I don't know
> why...
> 
> Mysql start write to log:
> 990613  0:55:11  Aborted connection 26274 to db: 'zavalinka' user: 'wwwsrv'
> 
> And script start write to con:
> --------------------------------------------------------------------------------
> Can't connect to local MySQL server through socket '/tmp/mysql.sock'
> (2) at /www /zavalinka/scripts/contact.pl line 7
> Can't call method "do" without a package or object reference at
> /www/zavalinka/scripts/talk.pl line 11.
> --------------------------------------------------------------------------------
> 
> Where is problem?
> Help me.
> 
> Thanks.
> 
> Max Chernykh
> mailto:max@stripped
> 

Max, your English is good enough...

Looks like somehow your Unix socket dies once in a while. How often does
this happen? Can you replicate the problem - put your server under
certain conditions that will cause the error?

What OS are you running and what version of MySQL? Can you re-post with
mysqlbug?

If flaky Unix sockets is the problem what Ritchie suggests will work -
force  TCP/IP by saying $database =
"dbi:mysql:host=".`hostname`.";database=zavalinka"; but you will see a
performance drop. Of course it is better to have a program that works
slowly than the one that crashes fast :-), but the best solution is the
one that works and does it fast.

-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
Aborted connection ... to dbMax Chernykh17 Jun
  • Re: Aborted connection ... to dbRitschie17 Jun
  • Re: Aborted connection ... to dbSasha Pachev17 Jun