Вот мое решение:
find sql/ -type f | awk '{system("mysql -u root -pXXX -h localhost mydatabase < "$0)}'