This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

mysql_kill

Syntax

int mysql_kill(MYSQL * mysql,
               unsigned long);

Description

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. If trying to kill the own connection mysql_thread_id() should be used.

Returns 0 on success, otherwise nonzero.

To stop a running command without killing the connection use KILL QUERY. The mysql_kill() function only kills a connection, it doesn't free any memory - this must be done explicitly by calling mysql_close().

See also

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.