Importing database in MySQL using command line - Rocketeers

 On this page

 Knowledge
---------

Importing database in MySQL using command line
==============================================

### [\#Databases](http://rocketee.rs/index.php/databases)

Importing a database in MySQL is quick &amp; easy using the command line.

 Published by Mark van Eijk on August 30, 2022 · 1 minute read

1. [Different options](#content-different-options)
2. [Using the command line](#content-using-the-command-line)

[\#](#content-different-options "Permalink")Different options
-------------------------------------------------------------

Importing a MySQL database can be done in several ways, using a desktop app or even using the legendary phpMyAdmin!

But the most effective and fast way to import a (large) SQL file remains - as always - using the command line interface (CLI).

[\#](#content-using-the-command-line "Permalink")Using the command line
-----------------------------------------------------------------------

Using the command below you can import large SQL files in the least amount of time:

 ```
mysql -u [username] -p [database]
