# MySQL 权限管理

> 来源：梦飞idc云平台 | 原文：https://www.mfisp.com/16545.html | 发布：2023-02-13 | 更新：2023-02-13 | 分类：建站教程、投稿分享

### 2.1 查看用户权限

 

#show grants for '用户名'@'主机名'  
mysql> show grants for 'mytest'@'%';

 

### 2.2 用户授权

 

#grant 权限列表 on 数据库名.表名 to '用户名'@'主机名'; (多个权限需要使用逗号隔开)  
mysql> grant all on *.* to 'mytest'@'%';

 

### 2.3 取消权限

 

#revoke 权限列表 on 数据库名.表名 from '用户名'@'主机名';  
mysql> revoke select on company.account from 'mytest'@'%';

 

![MySQL 权限管理](https://www.mfisp.com/wp-content/uploads/2022/10/11471-5iLLPQ.jpg)

---
本页由 梦飞idc云平台（https://www.mfisp.com）提供。站点导航见 https://www.mfisp.com/llms.txt
