title: MySQL Create DB/User from Batch File
body: <p>I am trying to setup an install script (batch file) that will automatically create a MYSQL database and a user when we install a service, assign the user to the DB, then run the install .sql file.</p>
  
  <p>Would this be correct?</p>
  
  <pre><code>@echo off
  c:\mysql\bin\mysql &lt; CREATE DATABASE hlstats;
  c:\mysql\bin\mysql &lt; CREATE USER 'username_here'@'localhost' IDENTIFIED BY 'password_here';
  c:\mysql\bin\mysql &lt; GRANT ALL ON hlstats.* TO 'username_here'@'localhost';
  c:\mysql\bin\mysql &lt; install.sql
  </code></pre>