Command Line mysql import syntax help

Hi there,

Having the same issue reporting in this closed thread: Can't import 130mb database - #4 by jasmink

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

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?


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?

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! :wave: