# 角色 Joe 现在是团队的 DBA,公司数据分析组有 Fred、Alice、James、Jone 四位成员,现在Joe需要给数据分析组授权,允许他们 查询 MySQL 8 服务器 goods 数据库中的所有表,*规范*的操作应该是
点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill)。 * `show databases` 列出所有数据库 * `show tables` 列出所有表 ## 答案 ```mysql create role analysis; grant analysis to fred, alice, james, jone; grant select on goods.* to analysis; flush privileges; ``` ## 选项 ### 将来人员变动管理会很繁琐 ```mysql grant select on goods.* to fred, alice, james, jone; ``` ### 错误的语法 ```mysql create role analysis; grant analysis to fred, alice, james, jone; grant all on all tables in schema goods to analysis; flush privileges; ``` ### 过度授权 ```mysql create role analysis; grant analysis to fred, alice, james, jone; grant select on *.* to analysis; flush privileges ; ```