mysql_kill
mysql_kill requests the MariaDB server to terminate the thread with the given process ID; use mysql_thread_id to obtain the ID of the current connection.
Syntax
int mysql_kill(MYSQL * mysql,
unsigned long pid);Parameters
mysql- a mysql handle, which was previously allocated by mysql_init() or mysql_real_connect().unsigned long- process id
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.
Return Value
Returns 0 on success, otherwise error on nonzero.
See Also
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

