0

I'm attempting to load approx. 15000 .csv files of about 8600 records each into a mysql table with the MySQL Workbench program. Is there a syntax for this that doesn't make me manually import 15000 files one at a time?

  • I mean, you can write a little script to iterate through the CSV files and then, for each one, import the data into MySQL (http://stackoverflow.com/a/11077961/899126). That would save you going through the Workbench interface – Chris Forrence Nov 10 '16 at 17:45
  • follow up question: what happens when several files at random intervals through the folder are incomplete and stop mid-record? Any attempt to just import one of those files throws an error. – Brian O'Connor Nov 10 '16 at 18:07
  • Well, using a script (and I have PHP in mind), you can wrap the logic in a try-catch to log problems (with the file name and exception message), but have it continue to the next file. Your other option would be to read each file, line by line, and insert that into the database. Given the size of your data, that _would_ take a while, but it would allow you to have more granular control over the import. – Chris Forrence Nov 10 '16 at 18:11

0 Answers0