title: Is it possible to backup records from a particular MySQL table a few at time with mysqldump? It's a table with a lot of records
body: <p>So I have a table with nearly 200,000 records that I want to clean up. However I want to back it up. I've tried using the phpMyAdmin interface but the script keeps timing out given the huge size of the database. I've event tried backing up 5000 at a time and it doesn't work.</p>
  
  <p>I'm wondering if I'll have a better time doing this from the command line using the mysqldump command. However, I'm having a hard time coming up with the command to:</p>
  
  <ul>
  <li>back up a particular database (say <code>db1</code>)</li>
  <li>back up a particular table in <code>db1</code> (say <code>table1</code>)</li>
  <li>back up a few records at a time (say 2500)</li>
  </ul>
  
  <p>I know that the issue is not a connectivity issue because I can connect to it. </p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>mysqldump --opt -h somedomain.com -u dbuser -p dbpass db1 table1 &gt; ./my-backup-file.sql
  </code></pre>
  
  <p>Any help would be greatly appreciated. </p>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I know what the problem is. A sign-up form was left open for anyone to sign up and a spam bot found it and hammered it with sign-up requests thereby creating something like ~ 199,980 new records in the database. So I know they're  standard varchar and text data being inserted. What i want to know is the easiest, pain, free way to clean it up.</p>