Execute MySql script from the command line

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/

Please remember to subscribe to the newsletter or feed to stay up to date.

Disclaimer: Thoughts and opinions are my own, and do not reflect the views of any employer, family member, friend, or anyone else. Some links may be affiliate links, but I do not link to anything I do not use myself.