title: How to import xml files with mysql LOAD XML LOCAL INFILE
body: <p>i need help with importing xml file to a table , xml file is having millions of records .</p>
  
  <p>first i was using simplexml_load_file and then put a loop to insert record one by one by that is taking a lot of time . i have used the infile for csv and that is working perfect , can anyone help , how can i do the same with xml .</p>
  
  <p>i'm trying with </p>
  
  <pre><code>LOAD XML LOCAL INFILE "C:/xampp/htdocs/class/on_the_list.xml" INTO TABLE tbl_juju ROWS IDENTIFIED BY '&lt;job&gt;' 
  </code></pre>
  
  <p>running this query says "MySQL returned an empty result set (i.e. zero rows)"
  and no records are inserted . below is the xml format .</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;rss version="2.0" xmlns:on-the-list="http://www.on-the-list.com/rss/2.0"&gt;
      &lt;positionfeed&gt;
      &lt;on-the-list:import user="accounts@juju.com" site="www.juju.com" /&gt;
      &lt;job&gt;
      &lt;id&gt;335951659&lt;/id&gt;
      &lt;employer&gt;The Judge Group&lt;/employer&gt;
      &lt;title&gt;Java Developer&lt;/title&gt;
      &lt;description&gt;Our client is currently seeking a Java Developer No C2C or 1099 Responsible for designing, developing, modifying, and evaluating programs for internal functional areas including finance, human resources, and marketing. Analyzes existing programs or formulates logic for new systems, devises logic procedures, prepares flowcharting, performs coding, and tests/debugs programs. Develops conversion and system implementation plans. Prepares and obtains approval of system and programming documentation. Recommends changes in development, maintenance, and system standards. Trains users in conversion and implementation of system. Education: 4-year degree in computer science or related field or equivalent experience Experience: 2+ years of experience in programming on enterprise or department servers or systems&lt;/description&gt;
      &lt;postingdate&gt;2017-02-25&lt;/postingdate&gt;
      &lt;joburl&gt;http://www.juju.com/jad/000000005k0lyj?partnerid=6facb3068fcc5ef5aa89a8cfe85e2aba&amp;amp;exported=True&amp;amp;hosted_timestamp=0042a345f27ac5dc911e5aa0246d6d5bb48607f376ce73ce76134eafb3ea2826&lt;/joburl&gt;
      &lt;location&gt;Jacksonville, FL&lt;/location&gt;
      &lt;category&gt;Software/IT&lt;/category&gt;
      &lt;zip /&gt;
      &lt;/job&gt;
      &lt;job&gt;
      &lt;id&gt;335951624&lt;/id&gt;
      &lt;employer&gt;Driveline Retail&lt;/employer&gt;
      &lt;title&gt;Retail Merchandiser&lt;/title&gt;
      &lt;description&gt;Drivelineis currently seeking motivated and career-minded candidates to join itsnational network of retail merchandisers. Weowe our continued success to the hard working, intelligent and innovativepeople who implement our retail programs every day. If you're interested injoining the team and helping our clients drive sales, then we'd love to hearfrom you. AboutDriveline: . Driveline is thelargest non-broker merchandising services agency in the country . Our clientsinclude major national retailers and manufacturers . Ourindustry-leading software makes your job easier and makes it easier than everto manage your own schedule and report hours . We offer full W-2employment, meaning no surprise tax bills from 1099 forms . We offercompetitive wages and opportunities for advancement (reimbursement is alsoavailable for travel more than 60 miles in one day) Desired experience/skills: . 1-2 yearsmerchandising or retail experience . Outstandingcustomer service skills . Ability to workboth independently and as part of a team . Ability to readstandard plan-o-grams and execute merchandise resets . Ability to liftup to 30 pounds and bend/stoop/stand for more than 45 minutes Requirements: . Reliabletransportation . Ability tomaintain a professional appearance . Computer access withprinter/Internet/email . Ability to reportcompleted work on the day of service Want to learn more or apply now? Go to www.drivelineretail.com , click on the"Apply Now" button in the top, right-hand corner of the page and complete anapplication. Our recruiters will handle the rest! We look forward to meeting you. -OR- APPLY NOW BY CLICKING BELOW ?territory_id_no=0 Desired experience/skills: . 1-2 years merchandising or retail experience . Outstanding customer service skills . Ability to work both independently and as part of a team . Ability to read standard plan-o-grams and execute merchandise resets . Ability to lift up to 30 pounds and bend/stoop/stand for more than 45 minutes&lt;/description&gt;
      &lt;postingdate&gt;2017-02-24&lt;/postingdate&gt;
      &lt;joburl&gt;http://www.juju.com/jad/000000005k0lxk?partnerid=6facb3068fcc5ef5aa89a8cfe85e2aba&amp;amp;exported=True&amp;amp;hosted_timestamp=0042a345f27ac5dc911e5aa0246d6d5bb48607f376ce73ce76134eafb3ea2826&lt;/joburl&gt;
      &lt;location&gt;St. Petersburg, FL&lt;/location&gt;
      &lt;category&gt;Retail&lt;/category&gt;
      &lt;zip /&gt;
      &lt;/job&gt;
      &lt;/positionfeed&gt;
      &lt;/rss&gt;
  </code></pre>
  
  <p>Waiting for your help .
  Thanks in advance .</p>