有没有办法使用 SQLyog 自动将数据从 Excel/csv 导入到 MySQL 数据库,以便每次自动更新?
最佳答案
使用数据库 -> 导入 -> 导入外部数据
每次都会自动发生什么?在 cronjob 上使用 LOAD DATA mysql 命令可能会更容易。
对于通过 CSV 进行的“更新”,请查看
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/