Skip to content

Instantly share code, notes, and snippets.

@codfish
Created February 24, 2015 15:57
Show Gist options
  • Save codfish/9c4f021a427c244e9110 to your computer and use it in GitHub Desktop.
Save codfish/9c4f021a427c244e9110 to your computer and use it in GitHub Desktop.
Create a new mysql user and grant them full priviledges to a specific database only.
-- This will be for ALL hosts, not just localhost, if you want it to only be for
-- localhost, then change 'codfish'@'%' to 'codfish'@'localhost'
CREATE USER 'codfish'@'%' IDENTIFIED BY 'password_here';
GRANT ALL PRIVILEGES ON `database_name`.* TO 'codfish'@'%';
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment