James Hawkins
James Hawkins

Reputation: 218

LOAD LOCAL XML INFILE runs without errors, but nothing loads

I am trying to load and XML file into a mysql table, without success. I've shrunk the db table down to a single row single column (there are more columns in the table) xml file to test this.

LOAD XML LOCAL INFILE  '/home/acct/public_html/db_files/data.xml' INTO TABLE db.table ROWS IDENTIFED BY '<DATA_ROW>'  

The entire XML file I am trying to load

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="DATA.xsd" generated="2018-04-26T13:52:35">
<DATA_ROW>
<NUMBER>414930440570</NUMBER>
<NAME_1>John Doe</NAME_1>
</DATA_ROW>
</dataroot>

When I run the LOAD XMLLOCAL INFILE command above it appears to run without error, but nothing loads into the table. What am I doing wrong?

Upvotes: 1

Views: 24

Answers (1)

nbk
nbk

Reputation: 49375

you have a typo it must be IDENTIFIED

LOAD XML LOCAL INFILE  '/home/acct/public_html/db_files/data.xml' 
INTO TABLE db.table1 
ROWS IDENTIFIED  BY '<DATA_ROW>'  

Upvotes: 1

Related Questions