Error when unpacking the database?

Unpack the database via the command line using the mysql command:

mysql-uusername -p password database < file.sql

The command line gives the following error:

ERROR 1064 (42000) at line 1: 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 'mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper Copy' at line 1


What's the problem? The discrepancy between the versions of MySQL? How to solve?
April 3rd 20 at 18:50
1 answer
April 3rd 20 at 18:52
Solution
Send us the output

head -5 file.sql

or just look yourself.
I think before the real dump file there are some crooked title.
head -5 file.sql
mysql Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using EditLine wrapper
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective - lina.Grady commented on April 3rd 20 at 18:55
Yes, apparently the file was broken. Thank you! - lina.Grady commented on April 3rd 20 at 18:58

Find more questions by tags LinuxMySQL