直接使用mysql的 INTO OUTFILE导出

SELECT Id,`Name`,Pid FROM `rc_china` INTO OUTFILE "e:/asdfgs.xls";

如果报错

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

解决:

在mysql配置文件加入后重启
secure_file_priv=''  

就ok了。

加入表头导入:

SELECT "id","name","pid" UNION SELECT Id,`Name`,Pid FROM `rc_china` INTO OUTFILE "e:/asdfgs.xls";

使用sql语句导出excel INTO OUTFILE

搞定!!!

相关文章:

  • 2021-12-04
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2021-12-04
  • 2021-11-23
  • 2021-08-07
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案