MySQL用户权限配置示例

移除权限

REVOKE命令

只保留SELECT权限

REVOKE INSERT,UPDATE,DELETE,CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON product.* FROM 'guest'@'localhost'
命令说明: REVOKE [权限列表,] ON {库名}.{表明} FROM '{用户名}'@'{host}'`

# 查看权限列表
SHOW GRANTS FOR 'woo_product'@'%';
GRANT USAGE ON *.* TO 'guest'@'%'
GRANT SELECT ON `product`.* TO 'guest'@'%'

你可能感兴趣的:(mysql)