Skip to content

Instantly share code, notes, and snippets.

@vojtasvoboda
Created September 16, 2014 11:22
Show Gist options
  • Save vojtasvoboda/03ce4c3496d5dc0d982f to your computer and use it in GitHub Desktop.
Save vojtasvoboda/03ce4c3496d5dc0d982f to your computer and use it in GitHub Desktop.
MySQL Create database and user
; user_name can be same like database_name
CREATE DATABASE `database_name`;
CREATE USER 'user_name'@'%';
GRANT ALL PRIVILEGES ON `user_name`.* TO 'database_name'@‘%';
SET PASSWORD FOR 'user_name'@'%' = PASSWORD('user_password');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment