Search code examples
mysqlprocesskill-process

Kill a mysql "add columns" when the process doesn't show up in processlist


I tried to insert a lot of columns (70) to a table that contains a lot of rows (1.5 million) and it is taking forever. I'd like to stop it without damaging the data. I read somewhere that I would need to run

show processlist

to find the process and then kill it. But when I do that I can only see one process and it is not the one I want to kill.

Does that mean it is not actually running? Or is there something else I should be doing? Any ideas?


Solution

  • For an unprivileged user, SHOW PROCESSLIST only shows sessions for the user that you are connected as.

    Connect to MySQL Server as the same user that is running the process you want to see.

    Or, connect as a privileged user. For example, 'root'@'localhost', or any user that is granted PROCESS privilege. Then SHOW PROCESSLIST will show sessions for all users.

    Reference: https://dev.mysql.com/doc/refman/5.7/en/show-processlist.html


    If SHOW PROCESSLIST only returns one row, that one row represents the session that's running the SHOW PROCESSLIST statement. Getting one row back means there are not other sessions from the same user. So that means that any other connections from the same user have been terminated.