小编Tec*_*hno的帖子

将 XML 转换为 MySQL 表

我有一个以下格式的大型 XML 文件,我需要将此文件转换为 MySQL 表。请让我知道我怎样才能做到这一点?

~~~~~~~~~~

<host starttime="1392325468" endtime="1392325486"><status state="up" reason="user-set"/>
<address addr="192.168.0.2" addrtype="ipv4"/>
<hostnames>
</hostnames>
<ports><extraports state="filtered" count="2">
<extrareasons reason="no-responses" count="2"/>
</extraports>
<port protocol="udp" portid="22"><state state="open|filtered" reason="no-response" reason_ttl="0"/><service name="ssh" method="table" conf="3"/></port>
<port protocol="udp" portid="123"><state state="open|filtered" reason="no-response" reason_ttl="0"/><service name="ntp" method="table" conf="3"/></port>
</ports>
</host>
Run Code Online (Sandbox Code Playgroud)

~~~~~~~~~~

mysql xml

8
推荐指数
1
解决办法
3万
查看次数

标签 统计

mysql ×1

xml ×1