I am writing this on the train, so I’ll be relatively quick.
It’s been a while since I wrote my import sql file via command line post and thought I’d post the updated version which I now use.
It is possible to execute an SQL file without logging into the mysql client first. Previously, I used login to mysql and use the source command to execute commands from an SQL text file.
Now, I execute it all straight from bash or windows shell without having to login to the MySQL client.
To import an SQL file by passing it as if it were an arguement, you need to use the < sign. So for example, say that I wanted to import an external database from production and wanted to import it into my development environment, I can do so by doing the following:
» Read more: Importing a SQL file directly from Command Line for MySQL

