且构网

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

如何将 CSV 文件导入 MySQL 表?

更新时间:2022-10-14 21:04:24

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

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

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.

Screenshot: "Import textfile" dialog

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