MySQL: Running a SQL script from the command line:
mysql mydatabase -u<mysql username> -p<mysql password> < /home/mysqlscript.sql
MySQL: Stopping a long query:
mysqladmin processlist
Get the id from the first column then run:
mysqladmin kill <ID>