Skip to content

Instantly share code, notes, and snippets.

@fede-green
Created October 19, 2017 10:17
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 fede-green/eb0245632eda1821e07a0eef63e011b9 to your computer and use it in GitHub Desktop.
Save fede-green/eb0245632eda1821e07a0eef63e011b9 to your computer and use it in GitHub Desktop.
#create the new user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
#create the new database
CREATE DATABASE newdatabase;
#assign the user to it
GRANT ALL PRIVILEGES ON newdatabase. * TO 'newuser'@'localhost';
#flush
FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment