How to import large sql files in XAMPP ?

You Installed XAMPP and you want to import existing data from other installation or from host.  First you need to export the data. In this case I’m using CakePHP installation and I want to have copy of my whole site on localhost installation.

But sometime we may face such a situation, import large sql files in XAMPP.

In this article you will learn how to import large sql files with the command prompt in XAMPP for Windows.

We will use Command-Line Tools (Shell) to import large database SQL file.

Import mysql db using command line is very simple statements and it effective and fast compare to importing huge database from phpmyadmin. There are one more advantage using this method the default mysql db upload file size is doesn’t a matter using Command-Line Tools (Shell).

1) Open the XAMPP Control Panel.

2) Make sure Apache and MySQL are running and click the Shell button in the XAMPP Control Panel.

xampp control panel

3) To import database, use the following command:

mysql -u username -p database_name < "c:\database_backup\database_file_name.sql"

command prompt

4) If you want to see import process to screen then use the following command:

mysql -u username -p -v database_name < "c:\database_backup\database_file_name.sql"

import process

5) Once your database SQL file successfully import then you will get following response like in the below image:

successfully response

Leave a reply
Captcha Click on image to update the captcha .