MySQL data import via the command line

If you're used working with phpmyadmin, you might find yourself a bit lost when you're working in an environment without php-support like, say, when you're setting up an nginx-based rails stack.

To import an export script (or any other slq script obviously), here's what you do:

mysql -u YOURNAME -p YOURPASS -D YOUBD < filename.sql

params:
-u: username
-p: password
-D: database name

Sweet, no?

Comments