Last active
February 12, 2018 13:02
-
-
Save ramezanpour/78feca40cc083f818c636310fb0ce8f9 to your computer and use it in GitHub Desktop.
Create a database and user in my sql and grant access to it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON [database] . * TO 'newuser'@'localhost'; | |
GRANT ALL PRIVILEGES ON [database].* TO 'newuser'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment