Oracle has a procedure called DBMS_APPLICATION_INFO.SET_APPLICATION_INFO
that allows you to specify up to 64k of addtional information about
the current connection.  It doesn't have any way to specify this
information at connect time though.

The data can be accessed in Oracle through the V$SESSION system view,
or through
userenv('CLIENT_INFO')

Something in mysql that would be similar and just as easy to implement would be:
create table process_info(ThreadID int, Information text, primary key
(ThreadID));

then in each connection do:
replace into process_info values (CONNECTION_ID(), 'Connection details here');

Add in a little cron job that removes old values from the process_info
table nightly and that should do the trick.


On Tue, 10 Aug 2004 15:24:34 -0700, Jeremy Zawodny <[EMAIL PROTECTED]> wrote:
> On Thu, Aug 05, 2004 at 12:36:55PM +0100, Naran Hirani wrote:
> > Hi,
> >
> > I'm using a single shared user-login for a web-based application to
> > my mysql database - is there a way of including some information at
> > connect time or during processing that would show up when issuing
> > `show processlist'?
> 
> Only if you prefixed each query with a comment:
> 
>   /* foo #3 */ SELECTL * FROM world ORDER BY...
> 
> But not at connect time.
> 
> > Basically, I need to able to distinguish potentially multiple
> > connections with the same login and process information some how.
> > This sort of thing is possible in other SQL engines so probably
> > should be in MySQL too.
> 
> Interesting.  How do other systems handle this?
> 
> Jeremy
> --
> Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
> <[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/
> 
> [book] High Performance MySQL -- http://highperformancemysql.com/
> 
> 
> 
> --
> 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]

Reply via email to