.\" Automatically generated by Pandoc 2.5
.\"
.TH "mysql_kill" "3" "" "Version 3.2.2" "MariaDB Connector/C"
.hy
.SS Name
.PP
mysql_kill \- Kills a connection
.SS Synopsis
.IP
.nf
\f[C]
#include <mysql.h>

int mysql_kill(MYSQL * mysql,
               unsigned long);
\f[R]
.fi
.SS Description
.PP
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()](SHOW
PROCESSLIST]].
If trying to kill the own connection \f[B]mysql_thread_id(3)\f[R] should
be used.
.SS Parameter
.IP \[bu] 2
\f[C]mysql\f[R] \- a connection identifier, which was previously
allocated by \f[B]mysql_init(3)\f[R] and connected by
\f[B]mysql_real_connect(3)\f[R].
Returns 0 on success, otherwise nonzero.
.IP \[bu] 2
\f[C]long\f[R] \- process id
.SS Notes
.IP \[bu] 2
To stop a running command without killing the connection use
\f[C]KILL QUERY\f[R].
.IP \[bu] 2
The \f[C]mysql_kill()\f[R] function only kills a connection, it
doesn\[cq]t free any memory \- this must be done explicitly by calling
\f[B]mysql_close(3)\f[R].
.SS Return value
.PP
Returns zero on success, non zero on error.
.SS See also
.IP \[bu] 2
\f[B]mysql_thread_id(3)\f[R]
.IP \[bu] 2
\f[B]mysql_close(3)\f[R]
.IP \[bu] 2
\f[B]mariadb_cancel(3)\f[R]