Re: maintaining size of a db

2003-11-13 Thread Scott H
= msyslog < /root/delete_old.sql ...and in /root/delete_old.sql, there is only this text (2 lines): select (@aa:=seq) as low_seq from syslogTB order by seq DESC limit 25,1; delete from syslogTB where seq < @aa; Thanks everyone for your help!! Scott --- Harald Fuchs wrote: > Scott

RE: maintaining size of a db

2003-11-12 Thread Scott H
Hey - Progress! But first, I had to correct: can't use "-p ", must use the longer form: "--password=" Then I can run it! One problem. It deleted the first 1000 records, rather than leaving the last 1000 records in the db. What twist is needed to get that right?

RE: maintaining size of a db

2003-11-12 Thread Scott H
e here? --- Dan Greene wrote: > for example your script would be > mysql --user=myuserid --password=mypassword -h > hostname < deleteold.sql > > see: > http://www.mysql.com/doc/en/Batch_mode.html > > > -Original Message- > > From: Scott H > [mailto:[E

RE: maintaining size of a db

2003-11-12 Thread Scott H
any other ideas/suggestions my way... thx!! --- Dan Greene wrote: > you may be able to put both statements to a > text file, let's call it deleteold.sql > > then your cron job would be : > > mysql (put your connect stuff here) < > deleteold.sql > > > From: Sco

RE: maintaining size of a db

2003-11-12 Thread Scott H
manual: > > 1.8.4.1 Subqueries > > Subqueries are supported in MySQL version 4.1. > See section 1.6.1 Features > Available in MySQL 4.1. > > Hope that helps, > > Mike > > > From: Scott H > > OK, I *THINK* I follow you here. Couple of > > quest

RE: maintaining size of a db

2003-11-12 Thread Scott H
2M) > again, use 10% for safety (1.8M) > > select (@aa:=id) as low_id from logtable order > by id limit 1800,1 > delete from logtable where id < @aa > > (do subqueries work with a limit clause?) > > > > -Original Message- > > From: Scott

RE: maintaining size of a db

2003-11-12 Thread Scott H
Failing that perhaps a delete statement that would just have it maintain a constant # of records? ...maybe this would be much simpler?) --- Dan Greene wrote: > cronjob a sql script that runs a delete > statement for old jobs daily > > > --- Egor Egorov wrote: > > > Scott

Re: maintaining size of a db

2003-11-12 Thread Scott H
--- Egor Egorov wrote: > Scott H wrote: >> Can't seem to find this one in the manual or >> archives - how do I control a db to maintain >> its size to an arbitrary value, say 20 GB? I >> want to just rotate records, deleting those >> that are oldest. >

Re: maintaining size of a db

2003-11-11 Thread Scott H
Repost - Haven't gotten any response on this and can't find an answer. If no one on the mysql list knows, where does a fellow turn? Help! > Can't seem to find this one in the manual or > archives - how do I control a db to maintain > its size to an arbitrary value, say 20 GB? I > want to just r

maintaining size of a db

2003-11-10 Thread Scott H
Can't seem to find this one in the manual or archives - how do I control a db to maintain its size to an arbitrary value, say 20 GB? I want to just rotate records, deleting those that are oldest. Thanks!! Scott . __ Do you Yahoo!? Protect your identity with Ya

Re: mysql noob can't get msyslog to connect to mysql

2003-11-04 Thread Scott H
Re-posted (corrected a typo in config file name): I want to set up a central log server, doing this on RH9. Using msyslog, a replacement for syslog which can log to a mysql db. I originally had msyslogd logging successfully to mysql. Great, but I want to be able to view my logs via http, and afte

mysql noob can't get msyslog to connect to mysql

2003-11-04 Thread Scott H
I want to set up a central log server, doing this on RH9. Using msyslog, a replacement for syslog which can log to a mysql db. I originally had msyslogd logging successfully to mysql. Great, but I want to be able to view my logs via http, and after having trouble setting up apache with PHP support