content_image/852376.jpg content_image/852375.jpg content_image/852374.jpg
<row>  <field name="person_id">5</field>  <field name="fname">Stoma</field>  <field name="lname">Nilu</field> </row> <row>  <field name="person_id">6</field>  <field name="fname">Nirtam</field>  <field name="lname">Sklöd</field> </row> <row>  <field name="person_id">7</field>  <field name="fname">Sungam</field>  <field name="lname">Dulbåd</field> </row> <row>  <field name="person_id">8</field>  <field name="fname">Sreraf</field>  <field name="lname">Encmelt</field> </row> </resultset> 

<img src='content_image/852376.jpg'>

<img src='content_image/852375.jpg'>

## Note 

The --xml  option causes the mysql  client to use XML formatting for its output; the -e  option causes the client to execute the SQL statement immediately following the option. See Section 4.5.1, “mysql — The MySQL Command-Line Client” . 

You can verify that the dump is valid by creating a copy of the person  table and importing the dump file into the new table, like this: 

mysql> USE test; mysql> CREATE TABLE person2 LIKE person; Query OK, 0 rows affected (0.00 sec) mysql> LOAD XML LOCAL INFILE ’person-dump.xml’ -> INTO TABLE person2; Query OK, 8 rows affected (0.01 sec) Records: 8 Deleted: 0 Skipped: 0 Warnings: 0 mysql> SELECT * FROM person2; 

<img src='content_image/852374.jpg'>

8 rows in set (0.00 sec) 

There is no requirement that every field in the XML file be matched with a column in the corresponding table. Fields which have no corresponding columns are skipped. You can see this by first emptying the person2  table and dropping the created  column, then using the same LOAD XML  statement we just employed previously, like this: 

mysql> TRUNCATE person2; 

