Skip to content

Instantly share code, notes, and snippets.

@cpetschnig
Created April 14, 2010 07:50
Show Gist options
  • Save cpetschnig/365567 to your computer and use it in GitHub Desktop.
Save cpetschnig/365567 to your computer and use it in GitHub Desktop.
MySQL: Create DB user and set permissions
-- create new user and give permissions to all databases of names starting with "USERNAME_"
CREATE USER 'my_new_user'@'localhost' IDENTIFIED BY '9ixv[jX6g33yD#lZl#T5dV5l882_Y';
GRANT ALL ON `my_new_user\_%`.* TO 'my_new_user'@'localhost';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment