1、使用SpreadsheetReader把数据写到txt,再用load data local 导入mysql
2、使用mysql load data local
$sql = "load data local infile '$txt_path' ignore into table 表名 character set gbk fields terminated by '_' lines terminated by '|'(`name`,`code`,`size`,`xingbie`,`type`,`names`,`lingshoujia`,`price`,`zaikushu`,`datetime`,`type_show`,`bili`);";
Db::execute($sql);
配置文件 'break_reconnect' => true,//断线重连
'params' => [
PDO::ATTR_CASE => PDO::CASE_LOWER,
PDO::ATTR_EMULATE_PREPARES => true,
PDO::MYSQL_ATTR_LOCAL_INFILE => true //开启local_infile
],