It's very simple thanks to pipes.
mysql -u username -p < sqlfile.sql
Make sure your sql file has a "use database" line.