Answer the question
In order to leave comments, you need to log in
Sudden errors when importing a database dump with the mysql utility. Is the dump done by mysqldump?
Hello!
Year 3 or 4, a script creates a database dump, and another script on another machine unrolls this dump.
Today I suddenly saw an error when importing a dump:
"ERROR 1064 (42000) at line 11926: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near 'SET @[email protected]@CHARACTER_SET_CLIENT */' at line 7"
# 1-st step: dump only structure into file:
system "mysqldump -h $dbhost $dbname -u$dbuser -p'$dbpass' --no-data --quick --single-transaction >> $homedir/1.sql";
# 2-nd step: dump DB data without CREATE tables, with ignore some tables
system "mysqldump -h $dbhost $dbname -u$dbuser -p'$dbpass' --quick --single-transaction --no-create-info $ignore_tables
>> $homedir/1.sql
";
mysql -u$dbuser -p$dbpass -D $database < $dbfile
Answer the question
In order to leave comments, you need to log in
It looks like you already had something in your $homedir/1.sql file. And this operator >>
just added dump requests to the file. Try to use >
if you don't need to append
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question