1

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?

Niraj Chauhan
  • 252
  • 2
  • 13

3 Answers3

6

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.

englebip
  • 186
  • 5
  • I am typing this in mysql.exe command prompt, but still its not working – Niraj Chauhan Apr 06 '11 at 11:33
  • check d:/database.sql. might have been overwritten by your previous efforts. – dom Apr 06 '11 at 11:36
  • no its still their – Niraj Chauhan Apr 06 '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 06 '11 at 11:45
  • from regular command prompt it shows as C directory, how can I bring shell? – Niraj Chauhan Apr 06 '11 at 11:49
  • I think the file should still be there, but its contents should have been overwritten by your previous efforts, as you were redirecting the output of mysql to it. Probably its empty or has something like `Ctrl-C -- exit!` Try opening it with a text editor; replace it with a fresh copy and try again if it's not right. – englebip Apr 06 '11 at 12:33
  • in command prompt how to bring the shell?? – Niraj Chauhan Apr 06 '11 at 13:10
0

Restoring of mysql db from dump file:

mysql -u root -p databasename < D:/database.sql
Suku
  • 2,006
  • 13
  • 15
0

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.