I am trying to execute foo.sql using the source command in MySQL.
When I type the command, the file is sourced accordingly:
mysql> source ~/foo.sql >
Use the command line:
mysql -p dbname < ~/foo.sql > ~/foo.txt