Friday, January 18, 2013

Mysql Xampp - Import large database through command prompt

There is limit to import database from GUI (phpmyadmin) in xampp. For large databases you can import via. comman line. Below are the steps you need to follow:

Step 1: Open / Run command prompt

Windows : Start > Rum > Type "cmd" > click "ok"


Step 2: By default it will point to documents & Settings/ user profile. you need to move to xampp root. If xampp is installed on other drive then default(where OS is installed).You need to switch directory.

For Example you have to switch from directory C to E
Type E:                                                                                                 //Press enter key.
Step 3: Now go to xampp directory

cd xampp                                                                                             //Press enter key.
Then move to  mysql/bin folder

Step 4: Now type below command

mysql -uroot -p databasename < path to sql file/file.sql                  
                                                                                               // Press enter. change user name if different

It will ask for "Enter Password:"

Enter password if any and press enter. If no password for user then direct press enter.

3 comments: