且构网

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

如何将.xls中的数据加载到mysql表中

更新时间:2023-11-02 13:01:04

您无法加载文件.xls(或.xlsx )直接格式化为MySQL。 LOAD DATA INFILE实用程序用于文本文件。



您可以将.xls文件另存为CSV并使用已有的代码或使用负载的实用程序。有几种可用(大多数是免费的) - 有些在此讨论 post [ ^ ]
You can't load a file in .xls (or .xlsx) format directly into MySQL. The LOAD DATA INFILE utility is meant to be used with text files.

You could save your .xls file as a CSV and use the code you already have, or use a utility to do the load. There are several available (most of them are free) - some are discussed on this post[^]