title: Batch file to connect mysql and run commands
body: <p>I want to run a batch file from windows, which connect to mysql server on different machine, and run a procedure from database or run a sql file which is sitting in my local machine.</p>
  
  <p>is there's a way to do it. I know that I need the below script in my batch file to run sql commands but I believe it's only work when you run the batch file in mysql server enviornment.</p>
  
  <p>do I have to define the server info (e.g IP address &amp; port)
  how do I do that</p>
  
  <p>any help would be appricated</p>
  
  <p>Thanks</p>
  
  <p>mysql --user=XXX --password=XXXX --database=XXX &lt; XXX.sql</p>