I need to grant privileges to a database from within a bash script. Some parameters are in the form of variables, say, the username and the password. The command in a mysql shell would look like this:
GRANT ALL ON *.* TO "$user"@localhost IDENTIFIED BY "$password";
...Except that $user
and $password
would be replaced by their values.
Is there a way to perform such a command from within a bash script?
Thank you!