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.
Would this be correct?
@echo off
c:\mysql\bin\mysql < CREATE DATABASE hlstats;
c:\mysql\bin\mysql < CREATE USER 'username_here'@'localhost' IDENTIFIED BY 'password_here';
c:\mysql\bin\mysql < GRANT ALL ON hlstats.* TO 'username_here'@'localhost';
c:\mysql\bin\mysql < install.sql