Importing database in MySQL using command line - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

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

### [\#Databases](https://rocketeersapp.com/knowledge/databases)

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

 Published by [Mark van Eijk](https://rocketeersapp.com/author/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]
