10.2.39 MySQLConnection.connection_id Property

This property returns the integer connection ID (thread ID or session ID) for the current connection or None when not connected.