Last active
April 18, 2022 18:30
-
-
Save caffeinetiger/b18e54b4d89393612b3f974ebc5948f2 to your computer and use it in GitHub Desktop.
Snippetse to help create/alter(update) a user in MySQL and grant permissions.
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
-- Create User | |
CREATE USER 'username'@'%' IDENTIFIED BY 'somepassword'; | |
-- Update User | |
ALTER USER 'username'@'%' IDENTIFIED BY 'somepassword'; | |
-- Grant to Specific Schema/DB | |
GRANT ALL ON some-schema.* TO 'username'@'%'; | |
-- Grant user permissions similiar to master user in RDS | |
GRANT ALL PRIVILEGES ON `%`.* TO 'username'@'%' WITH GRANT OPTION; | |
GRANT LOAD FROM S3 ON *.* TO 'username'@'%'; | |
GRANT SELECT INTO S3 ON *.* TO 'username'@'%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment