Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql ERROR 1064 (42000) when restoring mysqldump file

I created a mysql dump using code below:

sudo mysqldump --all-databases --user=root --password --master-data -create-options > alldatabase.sql

This is to migrate mysql data to a new mysql server.

Then, I tried to restore using code below:

sudo mysql -u root -p < backup.sql

but I get error:

ERROR 1064 (42000) at line 4171: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '*/' at line 1

I have beat my head against the wall trying to figure this out. Any suggestions?

Both servers are Debian using 10.1.38-MariaDB-0+deb9u1

like image 690
jakumpe Avatar asked Dec 03 '25 16:12

jakumpe


1 Answers

This error could appear when importing a truncated file. Please make sure that sql file is complete.

When using mysqldump like this there is no error message when disk is full.

like image 58
skolem Avatar answered Dec 06 '25 10:12

skolem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!