我正在运行load xml命令来将xml文件中的值填充到mysql表中,但它总是填充空值。
我正在运行以下命令:
的MySQL&GT;将xml local infile'E:\ Badges.xml'加载到由'<row>
'标识的表元行中
以下是我的文件内容:
<badges>
<row Id="1" UserId="2" Name="Autobiographer" Date="2010-08-25T19:26:49.550" />
<row Id="2" UserId="3" Name="Autobiographer" Date="2010-08-25T19:26:49.580" />
<row Id="3" UserId="6" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="4" UserId="15" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="5" UserId="18" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="6" UserId="21" Name="Autobiographer" Date="2010-08-25T19:46:49.197" />
<row Id="7" UserId="27" Name="Autobiographer" Date="2010-08-25T19:46:49.213" />
<row Id="8" UserId="7" Name="Autobiographer" Date="2010-08-25T19:51:49.327" />
</badges>
如果有人知道解决方案,请告诉我?
谢谢!提前 桑吉塔
答案 0 :(得分:0)
以下文件badges.xml
适用于我(护理区分大小写):
<badges>
<row id="1" userid="2" name="Autobiographer" date="2010-08-25T19:26:49.550" />
<row id="2" userid="3" name="Autobiographer" date="2010-08-25T19:26:49.580" />
<row id="3" userid="6" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="4" userid="15" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="5" userid="18" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="6" userid="21" name="Autobiographer" date="2010-08-25T19:46:49.197" />
<row id="7" userid="27" name="Autobiographer" date="2010-08-25T19:46:49.213" />
<row id="8" userid="7" name="Autobiographer" date="2010-08-25T19:51:49.327" />
</badges>
LOAD XML INFILE '/path/badges.xml' INTO TABLE meta ROWS IDENTIFIED BY '<row>';