HEX
Server: LiteSpeed
System: Linux srv1.dhviews.com 5.14.0-570.23.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jun 24 11:27:16 EDT 2025 x86_64
User: bdedition (1723)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/thread-self/root/proc/self/root/proc/thread-self/root/usr/share/mysql/man/man3/mysql_kill.3
.\" Automatically generated by Pandoc 2.5
.\"
.TH "mysql_kill" "3" "" "Version 3.3.1" "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]