=
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
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?
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
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
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
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
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
--- 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.
>
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
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-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
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
12 matches
Mail list logo