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.

We have created a dump file (.sql) using the command mysqldump in mysql5.5. Now we want to restore the same. We are using the command :-

-u[username] -p[pwd] [dbname] < [.sql file]

But we are not able to restore. We are using Win7 SP1 32 bit OS.

share|improve this question

closed as not constructive by Paul White, RolandoMySQLDBA, dezso, Leigh Riffel, Marian Mar 13 '13 at 9:46

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
You are using mysql to restore the dump created by mysqldump? If so, do you get an error? –  pritaeas Mar 5 '13 at 13:13
    
@PaulWhite I've closed that one in favour of this because Neeru said it had been answered here. Neeru please tick the answer that helped you! –  Jack Douglas Mar 6 '13 at 8:45

2 Answers 2

Looks like you left part of your command off. To be clear, you'll need to use the mysql client for the import. But, in general that should work. Another option is to just connect to the client (same command as before, but with out the the

Once in you can run

mysql> source /path/to/outfile.sql
share|improve this answer
up vote 0 down vote accepted

The problem got solved by using command prompt of Windows OS. Following are the steps:

  1. Change the directory to the one where your dump file is residing.

    cd /d [pathname]
    
  2. Execute the restore command

    mysql -u[username] -p[password] [dbname] < [filename]
    
share|improve this answer

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