将巨大的XML文件导入MySQL [英] Importing huge XML file to MySQL

查看:102
本文介绍了将巨大的XML文件导入MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在下载客户希望我上传到MySQL数据库中的单个表的900mb XML文件。我不得不在一周或两周之前插入一个6mb文件,我将文件转换为SQL查询,我可以在phpmyadmin中运行,但这需要相当长的时间。

I'm in the process of downloading a 900mb XML file that a client wants me to upload into a single table in a MySQL database. I had to insert a 6mb file a week or two ago which I did my converting the file to a SQL query which I could run in phpmyadmin, but that took a fairly long time.

这次我应该怎么做?谢谢

How should I go about it this time? Thanks

推荐答案

我会看看文件是否可以转换为CSV格式。导入MySQL表会快得多,因为没有处理XML。您只需要小心为每列输入的数据类型。

I would see if the file could be converted to CSV format. It will be much quicker to import into a MySQL table as there is no processing of the XML. You just have to be careful with the data types being input for each column.

如果客户端无法以CSV格式提供,则这是一次性上传,尝试使用MS Excel / Libre Calc / OpenOffice Calc自行转换。

If the client can't give you it in CSV, and this is a one time upload, try converting it yourself using MS Excel/Libre Calc/OpenOffice Calc.

这篇关于将巨大的XML文件导入MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆