简体   繁体   中英

How can I import data from excel to MYSQL?

I tried to import the data from excel to MYSQL by using the following command:

  load data local infile "filepath" into table mytab;

But this command is work for import the data from text file not for csv file or xlsx. I want to import the data directly from excel to MYSQL.

check following, see the seperator in your csv file and make sure you provide the correct one in command. Referance Link

load data local infile "filepath" into table mytab fields terminated by ';' enclosed by '"' lines terminated by '\r\n';

应该是您需要的命令,但是应该首先导出到csv。

您需要将Excel工作表转换为CSV文件,或使用MySQL for Excel来帮助完成该过程。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM