Importing MySQL database using Linux Terminal
You have to add the target database name.

$mysql -u root -p -h localhost

mysql&gt; create database foo;
mysql&gt; exit;

$mysql -u username -p -h localhost DATA-BASE-NAME &lt; data.sql