Load xml into mysql table with element

前端 未结 1 757
失恋的感觉
失恋的感觉 2021-01-25 00:42

I am trying to load an xml file in a table. The issue is that XML elements are being inserted into the table together with their data.

Here is the table fields:

相关标签:
1条回答
  • 2021-01-25 01:04

    Remove the semicolon after FIELDS TERMINATED ...

    You should use the LOAD XML ... Syntax, too. See http://dev.mysql.com/doc/refman/5.5/en/load-xml.html:

    The LOAD XML statement reads data from an XML file into a table
    

    Your LOAD DATA INFILE ... is used to load a flat-file (csv) to a table, not a XML:

    The LOAD DATA INFILE statement reads rows from a text file into a table 
    
    0 讨论(0)
提交回复
热议问题