如何将Excel数据导入到MySQL表中?
我有一个mileage_registrants
保持用户注册数据。 它有一个现在所有用户都为NULL
的字段department
。 我想从一个.xlsx
文件插入部门数据到表department
。 有一千条logging,所以我手工插入是非常可怕的。
有没有办法让我很快完成这个工作?
假设您可以访问PhpMyAdmin,则可能需要将xlsx导出为CSV格式,然后使用PhpMyAdmin导入工具导入它。
谨防编码虽然!
你可以通过excel itselfe来完成。
在这里,你可以find一个快速教程,你可以从MySQL与Excel交互
http://www.heritage-tech.net/908/inserting-data-into-mysql-from-excel-using-vba/
http://www.heritage-tech.net/267/interfacing-with-mysql-via-excel/
http://blog.tjitjing.com/index.php/2008/02/import-excel-data-into-mysql-in-5-easy.html
强烈build议在生产运行之前进行干运行