return mysql thread_id
Whenever I connect to mysql using command prompt, It returns a thread_id开发者_开发百科 (64 in this case). Is it possible to get this number using Java (preferred) or PHP?
# mysql -h10.10.10.10 -uroot -proot@123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 64
Server version: 5.0.77-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
CONNECTION_ID function will help you.
Query:
SELECT CONNECTION_ID();
精彩评论