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:
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
2010-02-15 12:36:08
Can this be done in a windows environment?
Undawned
2010-02-15 12:56:02