SELECT 查寻
INSERT 插入
UPDATE 更新
DELETE 删除
CREATE 创建
DROP 删除库和表和索引
REFERENCES 创建引用表的外键
INDEX 索引
ALTER 修改
CREATE TEMPORARY TABLES 创建临时表
LOCK TABLES 锁表
EXECUTE 执 行
CREATE VIEW 创建视图
SHOW VIEW 显示视图
CREATE ROUTINE 创建存储过程
ALTER ROUTINE 修改存储过程
EVENT 事件
TRIGGER 触发器
查看所有用户
select user,host from mysql.user;
创建并授权用户
grant all on *.* to zhengping@'%' identified by 'kmW3rRWs' with grant option;
with grant option 赋予该用户授权权限
查看授权用户权限
show grants for zhengping@‘%’;
实例
1创建一个应用用户wordpress,可以通过10网段,wordpress库下的所有表进行SELECT,INSERT, UPDATE, DELETE
grant SELECT,INSERT, UPDATE, DELETE on wordpress.* to wordpress@‘10.0.0.%’ identified by ‘123’;
2 回收权限
show grants for wordpress@‘10.0.0.%’;
mysql> revoke delete on wordpress.* from ‘wordpress’@‘10.0.0.%’;
mysql> show grants for wordpress@‘10.0.0.%’;