Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to restore a database backup created using mysqldump. If I do:

    $ mysqldump -u ROOT -p DATABASE_NAME < DATABASE.SQL

the database remains empty, even though I get some screen output and the line "Dump completed...", followed by a timestamp. I could not spot any error messages in the output

I made sure I quit MySQL before attempting the restore and I have tried to include the password in the command line, with no success. However, if I try:

    mysql>source /path_to_dump_file/DATABASE.SQL

it works just fine.

Any thoughts?

Many thanks in advance.

share|improve this question

2 Answers 2



instead of

share|improve this answer
That did the trick, thanks a bunch! –  taioba Dec 3 '13 at 14:01


ype the following command to import sql data file:

$ mysql -u username -p -h localhost DATA-BASE-NAME < data.sql

In this example, import 'data.sql' file into 'blog' database using vivek as username:

$ mysql -u sat -p -h localhost blog < data.sql

If you have a dedicated database server, replace localhost hostname with with actual server name or IP address as follows:

$ mysql -u username -p -h databasename < data.sql

OR use hostname such as mysql.cyberciti.biz

$ mysql -u username -p -h mysql.cyberciti.biz database-name < data.sql

If you do not know the database name or database name is included in sql dump you can try out something as follows:

$ mysql -u username -p -h < data.sql

Refer: http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html

If you want a GUI tool then you could probably use SQLyog or navicat for this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.