In MySQL query:
SELECT host
FROM information_schema.processlist
WHERE ID = connection_id( )
LIMIT 0 , 30
The result of ^ this query is: localhost
.
SELECT @@hostname;
The result of ^ this query is: localhost
.
But I need to get ipaddress like 192.168.1.2
.
Question: How to get this result using mysql query?
To get the IP address only without the port number.
Select SUBSTRING_INDEX(host,':',1) as 'ip'
From information_schema.processlist
WHERE ID=connection_id();