Skip to content

Instantly share code, notes, and snippets.

@YourFriendCaspian
Forked from blasterpal/mysql_grant.sql
Last active September 2, 2017 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YourFriendCaspian/a0e531d2f71191f7802f2f35a4ac3b5a to your computer and use it in GitHub Desktop.
Save YourFriendCaspian/a0e531d2f71191f7802f2f35a4ac3b5a to your computer and use it in GitHub Desktop.
Create mysql user with specific permissions
CREATE USER '<username>'@'%' IDENTIFIED BY '<password>';
# ALL PRIVILEGES is everything except grant
GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'%';
GRANT SELECT ON <database_name>.* TO '<username>'@'%';
GRANT SELECT ON <database_name>.* TO '<username>'@'%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment