Little Nugget of Wisdom #234: mysql data import via the command line

2007-03-23 / jpoesen

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 -usymbi -psekrit -Dmy_app < data_export.sql

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

Sweet, no?