At 11:12 AM -0800 12/15/06, Chris Comparini wrote:
Hello,
Say I wanted to log some various server status variables to
a table. What I'd like to do, ideally, is something like
this:
insert into SomeLogTable (Threads) show status like 'Threads_running';
MySQL does not allow this, of course. But, is there some other way
to see the "Threads_running" (or other status variables) such that
this would be possible?
Incidentally, one of the things I'd like to log thus is the slave
status "Seconds_Behind_Master". It's a little disappointing that
you cannot do this:
show slave status like 'Seconds_Behind_Master';
.. but rather have to get the entire slave status back in order
to see this one thing. Anyway...
If anyone has any ideas on this, I'd love to hear them.
If you're referring to MySQL status vars and you are using MySQL >=
5.0, you can indeed do this. For example:
[EMAIL PROTECTED]> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)
[EMAIL PROTECTED]> select @@wait_timeout;
+----------------+
| @@wait_timeout |
+----------------+
| 28800 |
+----------------+
1 row in set (0.00 sec)
Strangely, at least for me not all system vars can be accessed this
way; I haven't been able to see many innodb_... variables. But I
haven't played with this much, I might be doing something wrong.
For more info, see:
http://dev.mysql.com/doc/refman/5.0/en/using-system-variables.html
- steve
--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]