Skip to content

Instantly share code, notes, and snippets.

@mohitt
Last active December 15, 2015 12:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohitt/5260018 to your computer and use it in GitHub Desktop.
Save mohitt/5260018 to your computer and use it in GitHub Desktop.
Create a Mysql db with user and grant permissions, replace ##DBNAME## with database name and ##DBUSER## with username and ##DBPASSWORD## with new user password
CREATE DATABASE IF NOT EXISTS ##DBNAME##;
GRANT ALL on ##DBNAME##.* to '##DBUSER##'@'%' identified by '##DBPASSWORD##';
GRANT ALL on ##DBNAME##.* to '##DBUSER##'@'localhost' identified by '##DBPASSWORD##';
USE ##DBNAME##;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment