Re: Setting custom information in processlist
Thank you very much for your reply, Jeremy. I have been searching high and low for some sort of solution in MySQL, now I can stop. In answer to your question other systems simply allow certain attributes to be set at connection time, e.g. application_name, host_name, etc. So I normally post_fix to the application_name a short date-time value which allows me to distinguish connections in the list of processes on the server. Cheers, Naran Naran Hirani (Database/Software Specialist) MRC Rosalind Franklin Centre for Genomics Research Wellcome Trust Genome Campus, Hinxton, Cambridge, CB10 1SB, UK __ Tel: +44 (0)1223 494536 Fax: +44 (0)1223 494512 Web: www.rfcgr.mrc.ac.uk E-mail: [EMAIL PROTECTED] Jeremy Zawodny 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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Setting custom information in processlist
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]
Re: Setting custom information in processlist
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]