Skip to content

Instantly share code, notes, and snippets.

@tomysmile
Created November 1, 2015 04:51
Show Gist options
  • Save tomysmile/46091f6e030a62fc8713 to your computer and use it in GitHub Desktop.
Save tomysmile/46091f6e030a62fc8713 to your computer and use it in GitHub Desktop.
mysql: create user
mysql> CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'user_name'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'%' WITH GRANT OPTION;
mysql> flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment