2006-07-19

mysqldump: Error 2013

今天写了个小的脚本,把MySQL的数据从urts52复制到urts96时,运行时得到一些错误:
copying DWBdatabase4cd
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `TEXT_H` at row: 23854
copy database DWBdatabase4cd finished!
now copying DWVdatabase2
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `lemma` at row: 9251

出现这个问题的原因很有可能是max_allowed_packet变量的值设置太小了。
这儿有一个关于这个问题的讨论,和参看MySQL手册中相关的部分

脚本文件:

#! /bin/sh
#shell script to copy databases from urts52 to urts96
#databases=`mysql -hurts52 --exec="show databases;"`;
databases="DWBdatabase DWBdatabase2 DWBdatabase4cd DWVdatabase2 EWBdatabase FMBdatabase FSdatabase GWBdatabase HHPdatabase JBFDG JudenDB JudenDB2 JudenDB4 KWBdatabase LWBdatabase MWVdatabase MWVdatabase2 PWBdatabase RMnetAutor RMnetKarch RMnetLitDB RMnetPj RMnetREGIE RMnetThes RMnetcfg RWBdatabase THdatabase WBLinking WbbNetbase biosDB cctip2005 emtip2004 fragebogen fsl hhpforum hkfz luxbibldb mhgta moodle prodbase wikidb wmtip2002 wmtip2006 zForum zForum3 zforum zforum2";
#echo "mysqldump -h urts52 -ujia -p***** -Q --database $databases | mysql -h localhost"
for db in $databases;
do
echo "now copying $db";
mysqldump -h urts52 -ujia -pjia204 -Q --database $db | mysql -h localhost
echo "copy database $db finished!";
done
执行结果

jiad4701@urts96:~> ./copymysql2urts96.sh
now copying DWBdatabase
copy database DWBdatabase finished!
now copying DWBdatabase2
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `lemids` at row: 29181
copy database DWBdatabase2 finished!
now copying DWBdatabase4cd
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `TEXT_H` at row: 23854
copy database DWBdatabase4cd finished!
now copying DWVdatabase2
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `lemma` at row: 9251
copy database DWVdatabase2 finished!
now copying EWBdatabase
copy database EWBdatabase finished!
now copying FMBdatabase
copy database FMBdatabase finished!
now copying FSdatabase
copy database FSdatabase finished!
now copying GWBdatabase
copy database GWBdatabase finished!
now copying HHPdatabase
copy database HHPdatabase finished!
now copying JBFDG
copy database JBFDG finished!
now copying JudenDB
copy database JudenDB finished!
now copying JudenDB2
copy database JudenDB2 finished!
now copying JudenDB4
copy database JudenDB4 finished!
now copying KWBdatabase
copy database KWBdatabase finished!
now copying LWBdatabase
copy database LWBdatabase finished!
now copying MWVdatabase
copy database MWVdatabase finished!
now copying MWVdatabase2
copy database MWVdatabase2 finished!
now copying PWBdatabase
copy database PWBdatabase finished!
now copying RMnetAutor
copy database RMnetAutor finished!
now copying RMnetKarch
copy database RMnetKarch finished!
now copying RMnetLitDB
copy database RMnetLitDB finished!
now copying RMnetPj
copy database RMnetPj finished!
now copying RMnetREGIE
copy database RMnetREGIE finished!
now copying RMnetThes
copy database RMnetThes finished!
now copying RMnetcfg
copy database RMnetcfg finished!
now copying RWBdatabase
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `lemma` at row: 10388
copy database RWBdatabase finished!
now copying THdatabase
copy database THdatabase finished!
now copying WBLinking
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `ir_index_gwb` at row: 26021
copy database WBLinking finished!
now copying WbbNetbase
copy database WbbNetbase finished!
now copying biosDB
copy database biosDB finished!
now copying cctip2005
copy database cctip2005 finished!
now copying emtip2004
copy database emtip2004 finished!
now copying fragebogen
copy database fragebogen finished!
now copying fsl
copy database fsl finished!
now copying hhpforum
copy database hhpforum finished!
now copying hkfz
copy database hkfz finished!
now copying luxbibldb
copy database luxbibldb finished!
now copying mhgta
copy database mhgta finished!
now copying moodle
copy database moodle finished!
now copying prodbase
copy database prodbase finished!
now copying wikidb
copy database wikidb finished!
now copying wmtip2002
copy database wmtip2002 finished!
now copying wmtip2006
copy database wmtip2006 finished!
now copying zForum
copy database zForum finished!
now copying zForum3
copy database zForum3 finished!
now copying zforum
copy database zforum finished!
now copying zforum2
copy database zforum2 finished!

没有评论:

发表评论