Created
March 4, 2016 10:04
-
-
Save madmis/028f6e45d949090ac859 to your computer and use it in GitHub Desktop.
Create user
This file contains 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
// Show users | |
select * from mysql.user; | |
select host, user, password from mysql.user; | |
// Create user | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
// Grant privileges | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
GRANT LOCK TABLES, ALTER, INSERT, SELECT, UPDATE, CREATE TEMPORARY TABLES, TRIGGER, CREATE VIEW, SHOW VIEW, EXECUTE ON db_.* TO 'newuser'@'localhost'; | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment