MySQL: Running a SQL script from the command line:

mysql mydatabase -u -p < /home/mysqlscript.sql

MySQL: Stopping a long query:

mysqladmin processlist

Get the id from the first column then run:

mysqladmin kill