I have a mysql database with a single table, that includes an autoincrement ID, a string and two numbers. I want to populate this database with many strings, coming from a text file, with all numbers initially reset to 0.
Is there a way to do it quickly? I thought of creating a script that generates many INSERT statements, but that seems somewhat primitive and slow. Especially since mysql is on remote site.
Yes – use
LOAD DATA INFILEdocs are here Example :Notice the
setline – here is where you set a default value.Depending on your field separator change the line
FIELDS TERMINATED BY ','