tags:

views:

26

answers:

2

I have over 200 SQL files which contain misc data that need to be executed into my Mysql Database, I'm wondering if anyone knows a good way to accomplish this task other than executing each file one by one manually?

+1  A: 

simple merge this files into one and execute it

shuvalov
+1  A: 

In unix, where SOURCE_PATH_ROOT=the path to the root of your sqls, and MYSQL_OPTS=the options to your mysql command:

for sqlfile in `find ${SOURCE_PATH_ROOT} -name '*.sql'` ; do
    echo " "
    echo "  Reading `basename ${sqlfile}`"
    mysql ${MYSQL_OPTS} < ${sqlfile}
done
crunchdog
Can this be done in a windows environment?
Undawned