How to Find IP Address and PC Name- Bandi

Posted by Jayakumars under Sql Server on 5/1/2015 | Points: 10 | Views : 297 | Status : [Member] [MVP] | Replies : 4
hi

Bandi

How to Find Client IP Address and PC Name in Mysql only.

Mark as Answer if its helpful to you


Responses

Posted by: Bandi on: 5/4/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
For PC Name,
select VARIABLE_NAME , VARIABLE_VALUE from GLOBAL_variables where variable_name like 'hostname';

For IP Address,

Select SUBSTRING_INDEX(host,':',1) as 'ip' 
From information_schema.processlist
WHERE ID=connection_id();


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 5/4/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

pcname and ip not get i need local ip address like 192.168 this pc name local computername

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 5/4/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
bandi


select VARIABLE_NAME , VARIABLE_VALUE from GLOBAL_variables where variable_name like 'hostname';
i execute above query

eror throw this

Error Code: 1146. Table 'dbbank.global_variables' doesn't exist

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 5/4/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
look at this
http://stackoverflow.com/questions/6342201/bug-1146-table-xxx-xxxxx-doesnt-exist

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response