mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
###查看用户
use mysql;
select user,host from user;
####创建用户,不给任何权限
mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';
####给用户授权
mysql> grant select,insert,update,delete,index on myweb.* to 'webuser'@'localhost' identified by 'myselfweb';
####查看系统能权限定义
mysql> show privileges;
##########查看权限
show grants for 'webuser'@'localhost';
###########撤销权限
revoke create on myweb.* from 'webuser'@'192.168.0.102';
阅读(1473) | 评论(0) | 转发(0) |