I have a query running for some hours, if I cancel this query what is going to happen to the database?
The query is an ALTER TABLE
that adds a new column.
UPDATE: I executed the script this way
mysql -u username -p database
mysql> ALTER TABLE `table_name` ADD COLUMN `new_column` INT(1);
AFAIK you could run:
SHOW PROCESSLIST;
To see what thread it is then kill it:
KILL [CONNECTION | QUERY] thread_id;
About the side effects i won't be able to tell your exactly what could happen.
I could be wrong here, but if you don't specify a
BEGIN TRANSACTION
, each and every command is a self-contained transaction.As such, when you cancel the query there shouldn't be any side effects.