Re: host info

2005-04-28 Thread Eamon Daly
I'm an idiot. I completely forgot about USER():
mysql> select user(), SUBSTRING_INDEX(user(), '@', -1);
+-+--+
| user()  | SUBSTRING_INDEX(user(), '@', -1) |
+-+--+
| [EMAIL PROTECTED] | localhost|
+-+--+
More details in the usual place:
http://dev.mysql.com/doc/mysql/en/information-functions.html

Eamon Daly

- Original Message - 
From: "Stanton, Brian" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, April 27, 2005 2:07 PM
Subject: RE: host info


The 'Connection' output from the 'status' command is actually what I was
looking for.  However, most likely it will be a jdbc connection to mysql,
not the mysql client, so I'll have to see if it works that way or not.
Thanks,
Brian Stanton
-Original Message-
From: Eamon Daly [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 2:04 PM
To: Stanton, Brian; mysql@lists.mysql.com
Subject: Re: host info

I don't know if it's possible in MySQL.
That said, in the mysql client, you can type '\s' for
'status'. Look for 'Current user' in the output.

Eamon Daly

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: host info

2005-04-27 Thread mathias fatene
That's it:o)

Best Regards

Mathias FATENE
 
Hope that helps
*This not an official mysql support answer
 


-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: mercredi 27 avril 2005 23:12
To: 'mysql@lists.mysql.com'
Subject: RE: host info


Along those lines, you could use "show variables like 'pid_file'" if the
user needing to know the hostname has privileges for this.  Thanks for
the idea!

Thanks,
Brian Stanton

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 3:42 PM
To: Stanton, Brian
Cc: 'mysql@lists.mysql.com'
Subject: RE: host info

Hi all,
Mysql server knows the OS server as localhost. the hostname you see in
status is the OS server from which you connect (the client one), since
it's defined in the  grant.

The only method i can see is : ls /*.pid
its hostname.pid

You can do it also with *.err

Mathias


Selon "Stanton, Brian" <[EMAIL PROTECTED]>:

> The 'Connection' output from the 'status' command is actually what I 
> was looking for.  However, most likely it will be a jdbc connection to

> mysql, not the mysql client, so I'll have to see if it works that way 
> or not.
>
> Thanks,
> Brian Stanton
>
> -Original Message-
> From: Eamon Daly [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 27, 2005 2:04 PM
> To: Stanton, Brian; mysql@lists.mysql.com
> Subject: Re: host info
>
> I don't know if it's possible in MySQL.
>
> That said, in the mysql client, you can type '\s' for 'status'. Look 
> for 'Current user' in the output.
>
> 
> Eamon Daly
>
>
>
> - Original Message -
> From: "Stanton, Brian" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, April 27, 2005 10:03 AM
> Subject: host info
>
>
> > Does anyone know a function that will return the hostname of the 
> > mysql server you are connecting to?
> >
> >
> >
> > Just as:
> >
> > mysql> select database();
> >
> > returns the database you're connected to, I need to display the host

> > I'm connected to.
> >
> >
> >
> > Similar to the oracle statement: select host_name from v$instance;
> >
> >
> >
> > Thanks,
> >
> > Brian Stanton
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Stanton, Brian
Along those lines, you could use "show variables like 'pid_file'" if the
user needing to know the hostname has privileges for this.  Thanks for the
idea!

Thanks,
Brian Stanton

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 3:42 PM
To: Stanton, Brian
Cc: 'mysql@lists.mysql.com'
Subject: RE: host info

Hi all,
Mysql server knows the OS server as localhost. the hostname you see in
status is
the OS server from which you connect (the client one), since it's defined in
the
 grant.

The only method i can see is : ls /*.pid
its hostname.pid

You can do it also with *.err

Mathias


Selon "Stanton, Brian" <[EMAIL PROTECTED]>:

> The 'Connection' output from the 'status' command is actually what I was
> looking for.  However, most likely it will be a jdbc connection to mysql,
> not the mysql client, so I'll have to see if it works that way or not.
>
> Thanks,
> Brian Stanton
>
> -Original Message-
> From: Eamon Daly [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 27, 2005 2:04 PM
> To: Stanton, Brian; mysql@lists.mysql.com
> Subject: Re: host info
>
> I don't know if it's possible in MySQL.
>
> That said, in the mysql client, you can type '\s' for
> 'status'. Look for 'Current user' in the output.
>
> 
> Eamon Daly
>
>
>
> - Original Message -
> From: "Stanton, Brian" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, April 27, 2005 10:03 AM
> Subject: host info
>
>
> > Does anyone know a function that will return the hostname of the mysql
> > server you are connecting to?
> >
> >
> >
> > Just as:
> >
> > mysql> select database();
> >
> > returns the database you're connected to, I need to display the host I'm
> > connected to.
> >
> >
> >
> > Similar to the oracle statement: select host_name from v$instance;
> >
> >
> >
> > Thanks,
> >
> > Brian Stanton
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread mfatene
Hi all,
Mysql server knows the OS server as localhost. the hostname you see in status is
the OS server from which you connect (the client one), since it's defined in the
 grant.

The only method i can see is : ls /*.pid
its hostname.pid

You can do it also with *.err

Mathias


Selon "Stanton, Brian" <[EMAIL PROTECTED]>:

> The 'Connection' output from the 'status' command is actually what I was
> looking for.  However, most likely it will be a jdbc connection to mysql,
> not the mysql client, so I'll have to see if it works that way or not.
>
> Thanks,
> Brian Stanton
>
> -Original Message-
> From: Eamon Daly [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 27, 2005 2:04 PM
> To: Stanton, Brian; mysql@lists.mysql.com
> Subject: Re: host info
>
> I don't know if it's possible in MySQL.
>
> That said, in the mysql client, you can type '\s' for
> 'status'. Look for 'Current user' in the output.
>
> 
> Eamon Daly
>
>
>
> - Original Message -
> From: "Stanton, Brian" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, April 27, 2005 10:03 AM
> Subject: host info
>
>
> > Does anyone know a function that will return the hostname of the mysql
> > server you are connecting to?
> >
> >
> >
> > Just as:
> >
> > mysql> select database();
> >
> > returns the database you're connected to, I need to display the host I'm
> > connected to.
> >
> >
> >
> > Similar to the oracle statement: select host_name from v$instance;
> >
> >
> >
> > Thanks,
> >
> > Brian Stanton
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Stanton, Brian
The 'Connection' output from the 'status' command is actually what I was
looking for.  However, most likely it will be a jdbc connection to mysql,
not the mysql client, so I'll have to see if it works that way or not.

Thanks,
Brian Stanton

-Original Message-
From: Eamon Daly [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 2:04 PM
To: Stanton, Brian; mysql@lists.mysql.com
Subject: Re: host info

I don't know if it's possible in MySQL.

That said, in the mysql client, you can type '\s' for
'status'. Look for 'Current user' in the output.


Eamon Daly



- Original Message - 
From: "Stanton, Brian" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, April 27, 2005 10:03 AM
Subject: host info


> Does anyone know a function that will return the hostname of the mysql
> server you are connecting to?
> 
> 
> 
> Just as:
> 
> mysql> select database();
> 
> returns the database you're connected to, I need to display the host I'm
> connected to.
> 
> 
> 
> Similar to the oracle statement: select host_name from v$instance;
> 
> 
> 
> Thanks,
> 
> Brian Stanton

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: host info

2005-04-27 Thread Eamon Daly
I don't know if it's possible in MySQL.
That said, in the mysql client, you can type '\s' for
'status'. Look for 'Current user' in the output.

Eamon Daly

- Original Message - 
From: "Stanton, Brian" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, April 27, 2005 10:03 AM
Subject: host info


Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

Just as:
mysql> select database();
returns the database you're connected to, I need to display the host I'm
connected to.

Similar to the oracle statement: select host_name from v$instance;

Thanks,
Brian Stanton

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: host info

2005-04-27 Thread Berman, Mikhail
 
Brian,

Would it be feasible for you to work around this problem by:

1. Executing from UNIX prompt of your first server - "ssh second_server"
2. Executing "mysql -u user -p database"
3. Executing "mysql> system /bin/hostname"

Regards,

Mikhail Berman

 
-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 2:10 PM
To: 'mysql@lists.mysql.com'
Subject: RE: host info

Using 4.0.18...

connected from one unix box to another using mysql -h server -u user -p
database

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 12:30 PM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 Brian,

Have you initiated "mysql" command with  "-h host-name" option or just
"mysql" with other options but "-h"?

Mikhail Berman

-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 11:33 AM
To: 'mysql@lists.mysql.com'
Subject: RE: host info

Unfortunately, that gives me the host of the machine I'm connecting
from, not the server I'm connecting to.

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 10:28 AM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 
Brian,

In UNIX from "mysql" prompt do:

mysql> system /bin/hostname

Mikhail



-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 11:03 AM
To: 'mysql@lists.mysql.com'
Subject: host info

Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

 

Just as:

mysql> select database();

returns the database you're connected to, I need to display the host I'm
connected to.

 

Similar to the oracle statement: select host_name from v$instance;

 

Thanks,

Brian Stanton

 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Stanton, Brian
Using 4.0.18...

connected from one unix box to another using mysql -h server -u user -p
database

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 12:30 PM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 Brian,

Have you initiated "mysql" command with  "-h host-name" option or just
"mysql" with other options but "-h"?

Mikhail Berman

-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 11:33 AM
To: 'mysql@lists.mysql.com'
Subject: RE: host info

Unfortunately, that gives me the host of the machine I'm connecting
from, not the server I'm connecting to.

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 10:28 AM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 
Brian,

In UNIX from "mysql" prompt do:

mysql> system /bin/hostname

Mikhail



-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 11:03 AM
To: 'mysql@lists.mysql.com'
Subject: host info

Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

 

Just as:

mysql> select database();

returns the database you're connected to, I need to display the host I'm
connected to.

 

Similar to the oracle statement: select host_name from v$instance;

 

Thanks,

Brian Stanton

 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Berman, Mikhail
 Brian,

Have you initiated "mysql" command with  "-h host-name" option or just
"mysql" with other options but "-h"?

Mikhail Berman

-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 11:33 AM
To: 'mysql@lists.mysql.com'
Subject: RE: host info

Unfortunately, that gives me the host of the machine I'm connecting
from, not the server I'm connecting to.

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 10:28 AM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 
Brian,

In UNIX from "mysql" prompt do:

mysql> system /bin/hostname

Mikhail



-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 11:03 AM
To: 'mysql@lists.mysql.com'
Subject: host info

Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

 

Just as:

mysql> select database();

returns the database you're connected to, I need to display the host I'm
connected to.

 

Similar to the oracle statement: select host_name from v$instance;

 

Thanks,

Brian Stanton

 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Stanton, Brian
Unfortunately, that gives me the host of the machine I'm connecting from,
not the server I'm connecting to.

Thanks,
Brian Stanton

-Original Message-
From: Berman, Mikhail [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 10:28 AM
To: [EMAIL PROTECTED]; mysql@lists.mysql.com
Subject: RE: host info

 
Brian,

In UNIX from "mysql" prompt do:

mysql> system /bin/hostname

Mikhail



-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 11:03 AM
To: 'mysql@lists.mysql.com'
Subject: host info

Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

 

Just as:

mysql> select database();

returns the database you're connected to, I need to display the host I'm
connected to.

 

Similar to the oracle statement: select host_name from v$instance;

 

Thanks,

Brian Stanton

 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: host info

2005-04-27 Thread Berman, Mikhail
 
Brian,

In UNIX from "mysql" prompt do:

mysql> system /bin/hostname

Mikhail



-Original Message-
From: Stanton, Brian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 11:03 AM
To: 'mysql@lists.mysql.com'
Subject: host info

Does anyone know a function that will return the hostname of the mysql
server you are connecting to?

 

Just as:

mysql> select database();

returns the database you're connected to, I need to display the host I'm
connected to.

 

Similar to the oracle statement: select host_name from v$instance;

 

Thanks,

Brian Stanton

 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]