I\'m trying to automate MySQL user creation procedure. I thought of creating a temp file that would contain mysql user creation statements, then I would have call it like this :
If you do not want to store password in clear text, then save it in hashed format -
GRANT ALL PRIVILEGES ON mytestdatabase.* TO 'mytestdatabase'@'localhost'
IDENTIFIED BY PASSWORD '*7560636C2922C05954FE6A2446AA00C84708B57B';
Where hashed password is a result of this query -
SELECT PASSWORD('my password');