Skip to content

Instantly share code, notes, and snippets.

@scottoffen
Last active February 1, 2016 20:35
Show Gist options
  • Save scottoffen/10560794 to your computer and use it in GitHub Desktop.
Save scottoffen/10560794 to your computer and use it in GitHub Desktop.
Create New MySQL Database (with user)
-- Using GRANT for creating new users has been deprecated and will be removed in the future
-- as of 5.7.1
-- Create a new user
create user '[username]'@'[host]' identified by '[password]';
-- Create a new database/user
create database [schema];
-- Grant user access to database
grant all on [schema].* to '[username]'@'[host]' identified by '[password]';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment