Is there a way to import multiple csv files at the same time into a MySQL database? Some sort of batch import?
I\'m on Mac OSX running a MAMP server.
I have
For windows User use this batch
echo off
setlocal enabledelayedexpansion
FOR %%f IN ("*.csv") DO (
set old=%%~dpnxf
set new=!old:\=\\!
mysql -e "load data local infile '"!new!"' IGNORE into table email_us.business COLUMNS TERMINATED BY ','" -u root
echo %%~nxf DONE
)
d for drive letter, p for path
to file, n for filename, x for extension and f is file variableSteps: - Put that batch file in directory where all multiple csv files exist and named it as something.bat - run cmd.exe as adminstrator and call that something.bat file and enjoy importing...