Bug #22867 ERROR 2013 (HY000): Lost connection to MySQL server during query
Submitted: 30 Sep 2006 23:59 Modified: 1 Nov 2006 0:23
Reporter: didier dran Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version: 5.0.3-beta OS:4.11-RELEASE FreeBSD 4.11-RELEAS
Assigned to: CPU Architecture:Any

[30 Sep 2006 23:59] didier dran
Description:
On the server Cambronne the mail of the crontab user www says:

Message 2:
From www@cambronne.sfl.com Tue Sep 19 00:39:24 2006
Date: Mon, 18 Sep 2006 22:01:00 +0200 (CEST)
From: www@cambronne.sfl.com (Cron Daemon)
To: www@cambronne.sfl.com
Subject: Cron <www@cambronne> /usr/home/mysql/db/chargeart.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/www>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=www>
X-Cron-Env: <USER=www>

Preparation du fichierMon Sep 18 22:01:00 CEST 2006
----------------------------------------------------------
Informix Dynamic Server Version 7.30.UC8
INFORMIX-4GL Version 7.20.UD7
INFORMIX-SQL Version 7.20.UD7
----------------------------------------------------------
INFORMIXSERVER=nation_shm
ONCONFIG=onconfig.nation
     936985 enregistrements
Transfert du fichierTue Sep 19 00:36:43 CEST 2006
Formatage du fichierTue Sep 19 00:39:11 CEST 2006
Chargement du fichierTue Sep 19 00:39:24 CEST 2006
ERROR 2013 (HY000): Lost connection to MySQL server during query
Fin du traitement Tue Sep 19 00:39:24 CEST 2006

The script executed by the crontab of the user www is : 
www@cambronne$ more chargeart.sh

PATH=$PATH:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/home/www/bin/usr/local/b
in:export PATH
cd /usr/home/mysql/db
echo -n "Preparation du fichier";date
ssh batch2@nation /alize/appli/SITE/bin/basesite.sh /tmp/sitesfl.unl
echo -n "Transfert du fichier";date
scp batch2@nation:/tmp/sitesfl.unl .
echo -n "Formatage du fichier";date
sed -e "s/|/    /g" sitesfl.unl > site.txt
echo -n "Chargement du fichier";date
/usr/local/bin/mysql -D sfl <<!
delete from sfl_livres;
load data infile "./site.txt" into table sfl_livres;
!
echo -n "Fin du traitement ";date

How to repeat:
When not using the crontab:
logged fisrt root and www (su - www) after 
being in the directorie where the file is:
/usr/home/mysql/db
.................
usr/local/bin/mysql -D sfl <<!
delete from sfl_livres;
load data infile "./site.txt" into table sfl_livres;
!
works fine .
Why the script in the crontab don't ?
Thank you for help0
[1 Oct 2006 0:23] MySQL Verification Team
Thank you for the bug report. The version you are reporting is pretty older
could you please upgrade with the latest release and try again, if the issue
still happens reopen this bug report again. Thanks in advance.
[2 Nov 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".