# Command Line mysql import syntax help

**URL:** https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769
**Category:** Application Support
**Created:** [June 12, 2021, 12:44am UTC](https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769 "2021-06-12T00:44:40Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Aly\_WM](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/aly_wm/32/546_2.png) [@Aly\_WM](https://community.kinsta.com/u/Aly_WM)
#### Post date: [June 12, 2021, 12:44am UTC](https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769/1 "2021-06-12T00:44:40Z")

</div>

Hi there,

Having the same issue reporting in this closed thread: [Can't import 130mb database - #4 by jasmink](https://community.kinsta.com/t/cant-import-130mb-database/483/4)

I see a solution here with command line import, but need a little help getting the syntax correct:

> [@MySQL Import Via Command](https://community.kinsta.com/t/mysql-import-via-command/109):
>
> Hi, How to import a SQL file via command line ? ( i have a huge file …) Thank you

docker exec -i [mysql\_container\_name] mysql -u[username] -p[password] [DB name] \< [path/to/sql/file]

How do I make sure I’ve got the right file path to the sql file (on windows)? I’ve got it at c:\users\username (which is where terminal defaults to when I’m running the docker exec) so, I’ve put it together as follows with actual username/pw/db name replacing text in :

docker exec -i devkinsta\_db mysql -u[username] -p[password] [DB name] \< database.sql.gz

When I do this, I get what looks like the help menu, (no login error) but no import happens. I’m guessing I must be doing something wrong with the filepath? Or is there another step I need to do after running this command?

Thanks!!

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [June 14, 2021, 4:41pm UTC](https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769/2 "2021-06-14T16:41:39Z")

</div>

Welcome to DevKinsta @Aly_WM ! I’m happy to help.

The last piece there with `database.sql.gz` will depend if you’re already navigated to that directory. It looks like you got it correctly. Could you tell me what’s appearing on the screen when you insert that? Are you also inserted the DB name, etc?

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [October 29, 2021, 2:26pm UTC](https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769/3 "2021-10-29T14:26:17Z")

</div>

We haven’t heard back from you on this topic in a while. However, if you do need further assistance you can simply start a new forum thread. Thank you again for using DevKinsta. Let us know if you need further assistance! 👋

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [October 29, 2021, 2:26pm UTC](https://community.kinsta.com/t/command-line-mysql-import-syntax-help/769/4 "2021-10-29T14:26:18Z")

</div>


