Importing or Exportinglarge SQL file through PHPMyAdmin or Adminer may not be a good idea, since there is a chance of getting timeout or it's just taking to long to wait. A more powerful way to import large SQL file is through MySQL CLI. Laragon has its own environment terminal where all MySQL CLI command are executable from any directory. Let's try it out.
Checking the MySQL CLI command
Open the laragon terminal (Cmder), the working directory should be started atC:\laragon\www
by default.
Try to check the mysql version to confirm the command is available in the current directory or anywhere:
mysql--version
Creating a demo database (MySQL)
The completed credential example for this demo are:
- host:
localhost
- user:
myuser
- password:
mypassword
- database:
my_large_db
For the demo, you may want to create a new database namedmy_large_db
using web UI (phpMyAdmin or Adminer) or happily using this mysql cli command:
mysql-hlocalhost -umyuser -pmypassword -e"CREATE DATABASE my_large_db"
Importing Large SQL file (MySQL)
Let's say your large SQL file is located in theDownloads
folder and it's namedmy_large_db.sql
. Let's go the directory by terminal:
cdC:\Users\yourusername\Downloads
Then we can import the file from the directory using this command:
mysql-hlocalhost -umyuser -pmypasswordmy_large_db<my_large_db.sql
This import will take time but it's should faster than importing from a web UI.
Exporting Large DB (MySQL)
You can go to any directory you want using laragon terminal (Cmder) and that directory is where you will put the database dump file. Let's say we're gonna exporting the same datbase but into another sql file namedmy_large_db_backup.sql
:
mysql-hlocalhost -umyuser -pmypasswordmy_large_db>my_large_db_backup.sql
or alternatively usingmysqldump
command:
mysqldump-hlocalhost -umyuser -pmypasswordmy_large_db>my_large_db_backup.sql
Tell me if this article is so helpful and helped you solve your problem in the comment below. Have fun exploring laragon.
Top comments(1)

- Email
- LocationDhaka, Bangladesh
- Joined
Thank you dear for this artical
For further actions, you may consider blocking this person and/orreporting abuse