Last active
December 11, 2015 18:19
-
-
Save haio/4640413 to your computer and use it in GitHub Desktop.
mysql 权限控制
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
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'rootpasswd' WITH MAX_CONNECTIONS_PER_HOUR 5; | |
GRANT ALL PRIVILEGES ON *.* TO 'username'@'1.1.0.123' IDENTIFIED BY 'rootpasswd' MAX_CONNECTIONS_PER_HOUR 5; | |
GRANT SELECT ON dbname.* to 'username'@'%' IDENTIFIED BY by 'iamwangnc'; | |
FLUSH PRIVILEGES; | |
select * from mysql.user; | |
REVOKE ALL PRIVILEGES ON *.* TO 'root'@'%'; | |
delete from mysql.user where Host='%'; | |
FLUSH PRIVILEGES; | |
文档: | |
http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#user-names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment