mysql_thread_id — Returns the thread id for the current connection

unsigned long mysql_thread_id(MYSQL * mysql);

The mysql_thread_id() function returns the thread id for the current connection.

Parameters

mysql

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

Return value

The thread id for the current connection.

[Note]

The current connection can be killed with mysql_kill()

If reconnect option is enabled the thread id might change if the client reconnects to the server.

See also

mysql_kill(), mysql_options()