This tip is very similar to how to “[Execute a SQL file via the MySQL command line in one line][1]” only this time specifying the DB you want to execute the script against and being prompted for your password…
mysql -u user -p -h localhost MyDb < ~/SQL/script.sql[1]: http://markjacobsen.net/2012/12/execute-a-sql-file-via-the-mysql-command-line-in-one-line/