0

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? ?

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

This led me to the answer but I had to split the database in different SQL files too. Imported it in MySqlWorkbench and exported again. I think that it was related to some errors in the SQL but very strange that no errors displayed at all.
This might be because your dump file have more than one database in it, if this the case then you need to create separate dump files for each DB then source it using the above steps.
I have the same problem and I tried this command and I see that rows are inserted but when I check the tables of the database I find nothing. Any idea why this happens?
-1

please check your dump file it may be empty

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.