且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将CSV文件导入到MySQL表中?

更新时间:2022-03-19 16:53:50

问题的核心似乎在于将CSV文件中的列与表中的列进行匹配.

The core of your problem seems to be matching the columns in the CSV file to those in the table.

许多图形化的mySQL客户端都具有用于此类事情的非常好的导入对话框.

Many graphical mySQL clients have very nice import dialogs for this kind of thing.

我最喜欢这份工作的是基于Windows的 HeidiSQL .它为您提供图形界面来构建LOAD DATA命令.您可以稍后以编程方式重新使用它.

My favourite for the job is Windows based HeidiSQL. It gives you a graphical interface to build the LOAD DATA command; you can re-use it programmatically later.

屏幕截图:导入文本文件"对话框

要打开导入文本文件"对话框,请转到Tools > Import CSV file:

To open the Import textfile" dialog, go to Tools > Import CSV file: