title: Limiting mysql table to a sertain size and automatically deleting oldest entries
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8048001/how-can-i-set-a-maximum-number-of-rows-in-mysql-table">How can I set a maximum number of rows in MySQL table?</a>  </p>
  </blockquote>
  
  
  
  <p>Is it possible ( and how ) to put a limit on a MySQL table ( let's say 100'000 ) and deleting the old entries when limit reaches?</p>
  
  <p>Meaning, when I have 100'000 entries and the 100'001 appears, the entry with the smallest ID is deleted and the new one is created ( with the new ID of course ).</p>
  
  <p>I want MySQL to handle this on it's own, so no outside scripts need to interfere.</p>
  
  <p>I need this for logging purposes, meaning, I want to keep logs only for a certain time period, let's say a week. Maybe it is possible for MySQL just to delete entries, that are older then 1 week on it's own?</p>