CSV到MySQL的转换和导入 [英] CSV to MySQL conversion and import

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

问题描述

我在一个大项目上工作,havent不得不做我需要的帮助之前。我有一个csv文件,它包含大量的数据,即所有的城市,城镇,郊区在澳大利亚。我需要将csv文件转换为sql for mysql,然后将其导入到数据库。

Im working on a large project, havent had to do what I need help with before. I have a csv file, it contains a large amount of data, namely all of the cities, towns, suburbs in Australia. I need to convert the csv file to sql for mysql, and then import it into the database.

这是最好的方法是什么?

What would be the best way to achieve this?

推荐答案

使用 LOAD DATA INFILE 或等效命令行工具 mysqlimport

这些方法易于用于加载CSV数据,此方法的运行速度比使用SQL一次导入一行要快20倍。

These are easy to use for loading CSV data, and this method runs 20x faster than importing rows one at a time with SQL.

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

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