将csv导入到mysql数据表中

xiaoxiao2021-02-28  82

看了网上的很多代码,试了很多都没用。所以决定自己写个。

示例:load data local infile "E:/book1.csv" into table `monster`.`c_monstermodel` character set GBK fields terminated by ',' enclosed by '"' lines terminated by '\r\n';

"E:/book1.csv"是csv绝对路径。

 `monster`.`c_monstermodel` 中,monster是数据库名,c_monstermodel是数据表名。

character set GBK 设置编码格式

转载请注明原文地址: https://www.6miu.com/read-80694.html

最新回复(0)