How to stop a running procedure in MySQL?


Problem :

I called a procedure in MySQL, but it is in an endless loop now! How to stop a running procedure in MySQL? The following is my procedure code:

drop procedure if exists my_proc; 
DELIMITER $$
CREATE PROCEDURE my_proc
()
BEGIN
DECLARE VAR INT;
SET VAR=0;
WHILE VAR<10000
DO
INSERT INTO my_table () VALUES ();
END WHILE;
END; $$
DELIMITER;

CALL my_proc();


Solution :

Connect to the server (or use phpmyadmin or something similar) and do:

SHOW PROCESSLIST;

Find the process causing trouble, note its ID and do:

KILL ID_OF_YOUR_PROCESS;

Mysql Tutorials

Mysql Howto..

how to compare a table with itself under a condition in mysql

How to show MySQL errors from a failed Modx/xPDO query object?

Idiorm (MySQL) - Raw query - SHOW TABLES LIKE

How to check if table is empty , Execute and FetchRow methods in php and mysql

how to insert array without key to mysql?

How to change x and y coordinates from drawing PHP Mysql? [closed]

How do forums show you unread topics?

How to store a MySQL query (JSON) in android sqlite database?

How to protect user specified table name from SQL Injection in C#, using MySQL

How can I set up a mysqli object without actually connecting yet?

How to search in a large table with AES_DECRYPT?

how can i connect the MySql database in my computer to android application.?

How to create a login form with HTML, PHP and MySQL [closed]

MySQL - How to combine the column data into one row

How to use MySQL like with order by exact match first

How to search for record in mysql using php?

How do I create a CSV file from database in Python?

MySQL - How to diagnose cause of warning “Aborted connection - (Got timeout reading communication packets)”

Using image directory to show image

How to pivot a Key/Value style table into a normal table in MySQL

How would I globally add +1 to a table in mysql?

How to make my mysql queries for a friend feed on a large DB?

How to print the contents of array from an COUNT(*) ORDER BY Statement in MYSQL

how to use a MySql database within Eclipse

How can I fix my code to save 3 values in array using php, mysql to make a survey?

How to copy a row and insert in same table with a autoincrement field in MySQL?

How to pivot a column that is not unique in MySQL or SSIS?

How do I sorting MySQL result by ages from the birthday date

How to generate MD5 encrypted password in MySQL?

[Ruby/PostgreSQL]: How to host my first Ruby website?