Showing results for 
Search instead for 
Do you mean 

msyql - scripting

Highlighted
Super Advisor

msyql - scripting

Hi there

I want to do this from a script:

mysql -u root
GRANT ALL ON *.* TO 'xxx'@'localhost'IDENTIFIED BY 'xxx';
quit;


If I just stick "mysql -u root" inside a script then it opens mysql and wait's for user interaction. I need to grant the permissions for a certain user and move to other commands.

Reagrds
Jesus is the King
1 REPLY
Honored Contributor Honored Contributor

Re: msyql - scripting

The construct you are looking for is something like this :

...
other commands here
...

mysql -u root <GRANT ALL ON *.* TO 'xxx'@'localhost'IDENTIFIED BY 'xxx';
quit;
EOF

...
more commands here
...

hope this helps
________________________________
UNIX because I majored in cryptology...