Last active
January 27, 2016 10:18
-
-
Save seanhsu0102/e3ff548517f4a531ead5 to your computer and use it in GitHub Desktop.
MySQL add User (Grant)
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
GRANT ALL ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; | |
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON db_name.* TO 'username'@'localhost' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON *.* TO 'username'@'127.0.0.%' IDENTIFIED BY 'password' WITH GRANT OPTION; | |
GRANT REPLICATION SLAVE ON *.* TO repl@"192.168.1.%" IDENTIFIED BY 'password'; | |
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON db_name.* TO 'username'@'%' IDENTIFIED BY 'password'; | |
GRANT SELECT, LOCK TABLES ON *.* TO ‘backup’@’localhost’ | |
IDENTIFIED BY ‘backup_password’; # mysqldump | |
GRANT SELECT ON *.* TO ‘backup’@’localhost’ | |
IDENTIFIED BY ‘backup_password’; # mysqldump | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment