1

On a 5.5.23 server (stuck there at this point) I have a long running LOAD DATA INFILE statement that I need to stop because it's not working as I expected and I don't want to wait a few hours for it to finish. The table is InnoDB and I don't mind if it gets destroyed, I can recreate it easily.

What is the best way to stop this job without risking damage to anything other than this table? What if I just control-C this command?

1 Answer 1

0

Connect to your MySQL database as a user with the SUPER privilege (i.e. root) ; find the correct process with SHOW PROCESSLIST :

mysql> SHOW FULL PROCESSLIST\G
*************************** 1. row ***************************
Id: 3113
User: dumbass
Host: localhost
db: example
Command: Query
Time: 0
State: NULL
Info:  LOAD DATA INFILE 
...
*************************** 2. row ***************************
Id: 3123
User: hbruijn
Host: localhost
db: example
Command: Query
Time: 0
State: NULL
Info: SHOW FULL PROCESSLIST

and kill the offending thread.

mysql> KILL QUERY 3113
2
  • You can also kill your own connections (where the same user owns both threads) without SUPER. Jun 7, 2018 at 1:07
  • Please do not add a comment or an Answer to say "Thank you". - If you want to say "thank you," vote up that person's answer, or simply pay it forward by providing a great answer to someone else's question. - See this FAQ page with regards to the etiquette on ServerFault and related sites. - (If this is an Answer to a Question you yourself asked then you additionally have the option to accept it as the correct answer.)
    – HBruijn
    Jun 7, 2018 at 7:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .