开发者

return mysql thread_id

开发者 https://www.devze.com 2023-03-02 11:34 出处:网络
Whenever I connect to mysql using command prompt, It returns a thread_id开发者_开发百科 (64 in this case).

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();

0

精彩评论

暂无评论...
验证码 换一张
取 消