H M Kunzmann wrote: > > I use mysqldump to dump my databases to file. > I then write these files to tape. > > I was doing a test restore to a test server this weekend and found that > for my largest database, I cannot restore from this file. > > I use mysql < backup.script > > It runs for a long time and creates most of the tables, but eventually > comes up with a syntax error and stops processing the file. > > I have two questions: > How do I get around this ? The error message is: > > ERROR 1064 at line 78631: You have an error in your SQL syntax. Check the manual > that c > om:vml\"\r\nxmlns:o=\"u > > This data is xml data stored in one of the fields. If mysqldump created > the syntax surely it should process back in correctly ? There's no way I > can edit 2GB of incorrect entries in order to correct them. > > Secondly, how can I make the restore more fault tolerant ? If one call > fails to continue with the next one ? > > Thank > Ciao > Herbert > -- > Herbert Michael Kunzmann > Binary Chaos Magician
Herbert, It might be better if you do a per table export instead of whole database export. If you still have files that are too large to easily edit, use a utility like split to break them up. Below is the script we use to backup all of our tables except for 100_PATS and 400_PATS as those tables are dropped and reloaded everynight anyway. Hope this helps! walt #!/bin/bash cd /var/lib/mysql/NEA/ FILES=`ls *.frm` for file in $FILES; do LEN=${#file} STRIP=$((LEN -4)) table=`expr substr $file 1 $STRIP` if [ $table != "100_PATS" ] && [ $table != "400_PATS" ]; then /usr/bin/mysqldump -qt -u nea NEA $table -r /opt/db_dump/$table fi done exit 0 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]