I am looking for a way to insert all my csv files into mySQL without having to write several "LOAD DATA INFILE" statements as I have many csv files I need to insert and the files themselves are very large. I have tried *.csv but this does not work. Was wondering if anyone could help me out...
Thanks ahead of time.
Edit: I wrote a script which worked:
for f in /var/lib/mysql/[insert name of database here]/*.csv do mysql -e "LOAD DATA INFILE '"$f"' INTO TABLE [nameoftable] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 LINES" -u [username] --password= [password] [name of database] echo "Done: '"$f"' at $(date)" done