Cookies on this site

We would like to use cookies to understand how the site is used and to measure our campaigns. Nothing is set until you choose, and you can change your mind at any time from “Cookie settings” at the foot of every page. Privacy policy

Contact UsContact Us

Resources / Blogs

Cloud & apps

Batch execute mysql scripts from Windows NT shell

Executing hundreds of sql scripts for the initial setup of some schema is challenging. One line windows batch script to execute multiple sql scripts.

· · 1 min read

Mysql Scripts

Ever had to execute hundreds of sql scripts for the initial setup of some schema? This nifty one-liner will sort things out for you if you’re working on Windows platform:

FOR %%X IN (*.sql) DO mysql -u DB_USERNAME -pDB_PASS -h localhost SCHEMA_NAME< %%X

What this will do is, it’ll look for all the filenames with an extension of “.sql” in the current directory and log into the mysql server using username “DB_USERNAME” and password “DB_PASS” with the server host located at “localhost”.

Replace the username, password and host fields in the script with the credentials you use to log in to your database server.

Now the important thing to keep in mind is that this script will execute *all* files with and extension “.sql”, so if you want to avoid errors popping up while executing the scripts I’d suggest you to keep your tables details, constraints and triggers in separate folders and execute this batch script separately in each folder and you should be good to go!

← All articles

Case studies

Cloud Consulting in practice

Client names are withheld. We are happy to share details on a call.

All case studies
  • Delivered

    On-prem → Amazon RDS

    Nonprofit

    Cloud Consulting

    Oracle from on-premises to Amazon RDS for a national nonprofit

    The nonprofit's on-premises Oracle database had become hard to maintain and scale. We planned the move with automated workflows and validation tests, migrated to Amazon RDS for Oracle with minimal disruption and left a repeatable process for future changes.

    • Automated, tested migration
    • Less day-to-day database upkeep
  • Delivered

    600k files, < 3 days

    Document management

    Microsoft

    600,000 documents moved from ImageRight to SharePoint in under three days

    A one-file-at-a-time script would have needed about 22 days of continuous running. We rebuilt the migration around a SQL work queue with parallel uploads, automatic retries and crash recovery, and it finished unattended in under three days.

    • 1,125 → 8,314 files per hour
    • Under 3 days instead of about 22
  • Delivered

    Every change, flagged

    Food manufacturing

    AI Consulting

    Label comparison agent for a national food cooperative

    Compares two versions of a product label, highlights every change, annotates the PDF and returns an audit-ready list of differences. We moved it from Copilot Studio to Azure Functions when the document processing outgrew the low-code platform.

    • Audit-ready differences in one chat turn
    • Rebuilt from low-code to cloud functions

Keep reading

All Cloud & apps articles

Moving an application to the cloud?

Request a migration plan consult. We will scope the move with you and come back with a fixed-scope plan.