Mysql
 SQL >> Database >  >> RDS >> Mysql

Caricare un file XML in una tabella MySQL

Rimuovi il punto e virgola dopo FIELDS TERMINATED ....

Dovresti usare la sintassi LOAD XML ..., come descritto in https://dev.mysql.com/doc/refman/5.5/en/load-xml.html:

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

La tua istruzione LOAD DATA INFILE ... serve invece a caricare un file di testo (CSV) in una tabella, non un file XML:

The LOAD DATA INFILE statement reads rows from a text file into a table

In sintesi: usa LOAD XML per i file XML e LOAD DATA INFILE per i file piatti come i CSV.