mysql -u username -p database_name < file.sql

Check MySQL Options.

Example:

mysql -u root -p my_db < ~/Downloads/filename.sql
Advertisements