mysql - 使用 SQLyog 将数据从 Excel 导入到 MySQL 数据库

标签 mysql excel data-warehouse sqlyog

有没有办法使用 SQLyog 自动将数据从 Excel/csv 导入到 MySQL 数据库,以便每次自动更新?

最佳答案

使用数据库 -> 导入 -> 导入外部数据

每次都会自动发生什么?在 cronjob 上使用 LOAD DATA mysql 命令可能会更容易。

对于通过 CSV 进行的“更新”,请查看

http://www.softwareprojects.com/resources/programming/t-how-to-use-mysql-fast-load-data-for-updates-1753.html

Step 1: Use LOAD DATA to import the entire input file into a temporary table and update primary key id's for any existing records we already have

Step 2: Use SELECT INTO OUTFILE to write all records we couldn't find an id for (new records) into a temporary text file

Step 3: Use LOAD DATA to add all new records (from step 2) into the target table

Step 4: Use a single UPDATE query, to update all records that match an existing primary key 

关于mysql - 使用 SQLyog 将数据从 Excel 导入到 MySQL 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30396759/

相关文章:

mysql - 反序列化,再次序列化和更新值

php - 如何从另一个表中选择表中的特定条件

excel - Excel 中的值排序问题

Azure 数据从 Azure Db 同步到 Azure DWH

sql-server - Microsoft 立方体使用边界和最佳实践

mysql - 如何正确连接两个表以使用替代 ORDER BY

mysql - 从存储函数中的 DATE_SUB/DATE_ADD 返回值

excel - 用户表单列表框点击代码不会触发

vba - 在 VBA 完成执行之前,Power Query 表不会下载数据

database - 维度建模 : need help doing this star for a university