7am utc to pst. Found a bug, have feedback, questions or ideas?
When you have large SQL file and you want to import existing data from other installation or from host. First you need to export the data. But sometime we may face such a situation, import large sql file in XAMPP.
In this article you will learn how to import large sql file with the command prompt in XAMPP for Windows.
In the Django Installation tutorial, we installed Xampp, it’s a great tool and is a prerequisite for MySQL. Don’t worry you won’t need to learn SQL for that, all the backend code will be done in python, that is the advantage of Django Model. XAMPP only offers MySQL (Database Server) & Apache (Webserver) in one setup and you can manage them with the xampp starter. After the successful installation navigate to your xampp folder and execute the xampp-control.exe. Press the start Button at the mysql row. Now you've successfully started mysql.
We will use Command-Line Tools (Shell) to import large database SQL file.
Import mysql db using command line is very simple statements, 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).
Xampp Mysql Tutorial
#1. Open the XAMPP Control Panel
Make sure Apache and MySQL are running and click the Shell button in the XAMPP Control Panel.
#2. To import database, use the following command
- username – your MySQL username. e.g. root
- database_name – database name you are importing to
- /path/file.sql – full path to your .sql file
when you haven’t created a MySQL username. In that case, you need to type “root” for the username.
Note: On the below screen command, you will define own define own database name. The database name will be the one that you created in the phpMyAdmin and would like to import to SQL file. In our case, we have database name “the_code_developer”.
Android Php Mysql Xampp Tutorial
Enter password: (leave it blank, it’s not set by default) and click enter to continue process.
#3. If you want to see import process to screen then use the following command
Once your database SQL file successfully import then you will get following response like in the below image.