title: Equivalent Windows Script to run a SQL in all databases in MySQL?
body: <p>We can run a sql in all databases using the following script in unix/linux</p>
  
  <pre><code>#!/bin/sh
  
  all_dbs="$( mysql  -hlocalhost  -uroot  -pmysql -Bse 'show databases')"        
  for db in $all_dbs
  do
      if test $db != "information_schema" -a $db != "mysql"   -a $db != "my_db" 
      then 
          echo $db
          mysql  -hlocalhost  -uroot  -pmysql $db  &lt; temp.sql
      fi  
  done
  </code></pre>
  
  <p>the temp.sql holds the select statement</p>
  
  <p>Could someone helps me with the Windows Equivalent script as i am working with windows?</p>
  
  <p>Thanks in advance,
  Kathir</p>