Search This Blog

Wednesday 23 October 2013

IMPORT A DUMP INTO MYSQL


IMPORT A DUMP INTO MYSQL

Incase you wanna import a mysql database dump follow the following steps:

Open command-promt in your system (Windows + cmd)...
Now, goto the file location and then run this command

G:\data\>mysql -u root -proot myNewDB< mydump.sql


where,
  • say my file was in G:Drive so G:\data\  & mysql- (username = root & password=root)
  • myNewDB is the DB(newly created/existing) where you wanna import the mysql dump.
  • mydump.sql is name of the mysql-dump file.


--
Plz : Do post your valuable comments in case this doesn't work for you. Thanks In Advance...!!! 

1 comment:

  1. Note: Dont use a semicolon @ end of your command ..or you might get an error saying -- "Unknown Database #you-database-name# ".

    Correct Format : G:\data\>mysql -u root -proot myNewDB< mydump.sql
    Incorrect Format : G:\data\>mysql -u root -proot myNewDB< mydump.sql ;

    ReplyDelete