Saturday, June 13, 2020

How To Import Large Sql File In XAMPP ?

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


#1. Open the XAMPP Control Panel


Where:
  • 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.


example: mysql -u root -p the_code_developer< "htdocs/drupal8/tasalliresort/APP-DATA.sql"

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 “tasalli”.



here the database phpmyadmin

#2. For Mamp

Step 1:- cd /Applications/MAMP/bin


Step 2:-   mysql -u root -p testundp < /Users/lakhan.thakur/Desktop/live.sql


Step 3:-  Pass




5 comments:

  1. Import the database in MAMP using command: goto the bin folder and run that which is shar in below:
    step 1: given make the data base like ex "undp17"
    Step 2: given the path.
    lakhan.thakur@FVFZM46XL410 bin % mysql -u root -p undp17 > /Users/lakhan.thakur/Downloads/17-02-22.sql
    Enter password: root

    ReplyDelete
    Replies
    1. lakhan.thakur@FVFZM46XL410 bin % mysql -u root -p undpme < /Users/lakhan.thakur/Desktop/backupme.sql
      Enter password:

      Delete
  2. lakhan.thakur@FVFZM46XL410 bin % mysql -u root -p undpme < /Users/lakhan.thakur/Desktop/backupme.sql
    Enter password:

    ReplyDelete
  3. mysql> create new_database;
    mysql> use new_database;
    mysql> source (Here you need to import the path of the SQL file);

    E.g.:
    mysql> source E:/test/dump.sql;

    ReplyDelete
  4. c:\xampp\mysql\bin

    # mysql -u root -p

    MariaDB [(none)]> show databases;

    MariaDB [(none)]> create database DBname;

    MariaDB [(none)]> use DBname; Database changed

    MariaDB [mydata]> show tables; Empty set (0.001 sec)
    MariaDB [mydata]> select * from tablename;

    MariaDB [mydata]> source E:/test/dump.sql;

    ReplyDelete

If you have any problem please let me know.