Mark McAulay

Digital Guy 
« Back to blog

import a sql file on the MySQL command line

Because I had to figure this out the hard way, Here's a reminder for myself and others on the best way to accomplish this. I had a 21MB file.

Assuming you already have your dumped sql file.

  1. remember where you saved the file
  2. log into mysql command line client
  3. run this: source /full/path/to/your/file.sql
  4. bask in glory

Comments (1)

Jul 01, 2010
cole007 said...
not tried that one and something i am always forgetting.
when had to do command line imports always erred towards mysql -u USER -p DBNAME < dump.sql
(see http://answers.google.com/answers/threadview?id=24558)

Leave a comment...