Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running wamp on my local host, the question is, how do I import 2GB mysql database backup file into phpmyadmin. I tried this command in mysql command line

mysql -u root -p databasename > D:/database.sql

but didn't work, is their any other way to do it?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Try reversing the redirection:

mysql -u root -p databasename < D:/database.sql

'>' means to redirect the stdout; '<' redirects stdin

If you are indeed using phpMyAdmin, as you say you are, you can log in to it with your same credentials and go to the "Import" tab (one before the last one) and upload the file.

share|improve this answer
    
I am typing this in mysql.exe command prompt, but still its not working –  ntechi Apr 6 '11 at 11:33
    
check d:/database.sql. might have been overwritten by your previous efforts. –  dom Apr 6 '11 at 11:36
    
no its still their –  ntechi Apr 6 '11 at 11:40
    
you mentioned mysql.exe command prompt, are you in the mysql shell or a regular command prompt? this needs to be done from a regular command prompt. –  dom Apr 6 '11 at 11:45
    
from regular command prompt it shows as C directory, how can I bring shell? –  ntechi Apr 6 '11 at 11:49

Did you try Bigdump? This has nothing to do with PhpMyadmin but will stagger import a local file and tries to execute each set of lines in a session.

share|improve this answer

Restoring of mysql db from dump file:

mysql -u root -p databasename < D:/database.sql
share|improve this answer

Your Answer

 
discard

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.