php - Importing multiple files into MySQL table -


this question has answer here:

i trying import bunch of text files(3098) mysql table. there no problem importing single file load data local infie. files in 1 folder. reckon need use foreach not sure how it.is possible without php. helpful.

run following shell script

for f in /path/to/files/folder/*.txt     mysql -e "load data infile '"$f"' table [tablename] fields terminated ',' lines terminated '\n' ignore 1 lines" -u [username] --password= [password] [databasename] echo "done: '"$f"' @ $(date)" done 

Comments

Popular posts from this blog

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

java - ConcurrentModificationException upon committing transaction with Hibernate -