mysql_kill — Asks the server to kill a connection thread.

int mysql_kill(MYSQL * mysql,
               unsigned long);

This function is used to ask the server to kill a MariaDB thread specified by the processid parameter. This value must be retrieved by SHOW PROCESSLIST or if the own connection should be killed by mysql_thread_id().

Parameters

mysql

A mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().

long

process id

Return value

Returns 0 on success, otherwise nonzero.

[Note]

To stop a running command without killing the connection use KILL QUERY.

mysql_kill() function only kills a connection, it doesn't free any memory - this must be done explicitly by calling mysql_close()

See also

mysql_thread_id(), mysql_close()