Created
June 19, 2019 19:36
-
-
Save nodesocket/b4015be57e294064d493b9762cc030cf to your computer and use it in GitHub Desktop.
MySQL create user and assign permissions to database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export MYSQL_USER="" | |
export MYSQL_PASSWORD="" | |
export DATABASE="" | |
CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD'; | |
GRANT ALL PRIVILEGES ON $DATABASE . * TO '$MYSQL_USER'@'%'; | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read only
GRANT SELECT ON $DATABASE . * TO '$MYSQL_USER'@'%';