Claudio Ferraro
Claudio Ferraro

Reputation: 4721

Mysql command returns no errors and doesn't import the sql file. Why?

I'm executing on a Centos Linux server this command:

mysql -u root -p mydatabase < dump.sql

I enter the password. It seems that all is ok because I absolutely get no errors, no messages that something happened. But sadly, the file is not imported!

Tryed in different ways: -Putting the sql file in another location. -Creating the DB first and than without the DB. -Avoiding the dbname -Adding max_allowed_packet=800M in /etc/my.cnf (because the file is 490mb) -Restarted Mysql. But nothing to do. No errors, no import. I'm stuck and in panic. What to do? ?

Upvotes: 0

Views: 2419

Answers (2)

Abishek
Abishek

Reputation: 1

please check your dump file it may be empty

Upvotes: -1

Mukesh S
Mukesh S

Reputation: 2886

If you have already created database then use below steps to import data from .sql file

DataBase to use:

 use DataBaseName;

Give the source file path

source /path/to/dump.sql;

Hope this will help

Upvotes: 1

Related Questions