title: MySQL script to delete data in chunks until everything lower then id has been deleted
body: <p>I need an MySQL Skript which does the following:</p>
  
  <p>delete chunks of the database until it has deleted all link_id's greater then 10000</p>
  
  <p>exmaple:</p>
  
  <pre><code>x = 10000
  DELETE FROM pligg_links WHERE link_id &gt; x and link_id &lt; x+10000
  x = x + 10000
  ...
  </code></pre>
  
  <p>So it would delete</p>
  
  <pre><code>DELETE FROM pligg_links WHERE link_id &gt; 10000 and link_id &lt; 20000
  </code></pre>
  
  <p>then</p>
  
  <pre><code>DELETE FROM pligg_links WHERE link_id &gt; 20000 and link_id &lt; 30000
  </code></pre>
  
  <p>until all id's less then 10000 have been removed</p>
  
  <p>I need this because the database is very very big (more then a gig)</p>
  
  <p>thank in advance</p>