Skip to content

Instantly share code, notes, and snippets.

@nodesocket
Created June 19, 2019 19:36
Show Gist options
  • Save nodesocket/b4015be57e294064d493b9762cc030cf to your computer and use it in GitHub Desktop.
Save nodesocket/b4015be57e294064d493b9762cc030cf to your computer and use it in GitHub Desktop.
MySQL create user and assign permissions to database
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;
@nodesocket
Copy link
Author

Read only

GRANT SELECT ON $DATABASE . * TO '$MYSQL_USER'@'%';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment