|
本题添加时间:2023/7/3 22:19:00 |
|
圆梦客服:王老师 19139051760(微信同号) 19139051760(微信同号) |
登录root账户创建普通账户并给普通账户授权: (1) 创建一个密码为“123456”的普通用户账户“databasenormal”; (2分)
(2) 创建名为student的数据库;(2分)
(3) 创建名为student2的表,包括stuno(学号列)、stubir(生日列)、age(年龄列),并设置主键为stuno;(8分)
(4) 使用grant命令对其进行student 数据库的student2的表的stuno列的select操作授权; (2分)
(5) 查看mysql数据库下user表中该用户的所有信息;(2分)
(6) 查看mysql数据库下table_priv表中该用户的所有信息;(2分)
(7) 查看mysql数据库下columns_priv表中该用户的所有信息;(2分)
|
答案是:(1)创建一个密码为“123456”的普通用户账户“databasenormal”; (2分)
答案: create user ‘databasenormal’@’localhost’ identified by ‘123456’; (2)创建名为student的数据库(2分)
答案: create database student; (3)创建名为student2的表,包括stuno(学号列)、stubir(生日列)、age(年龄列),并设置主键为stuno(8分)
答案: create table student2 ( stuno char(50), stubir char(4), age int, PRIMRY KEY stuno ); (4)使用grant命令对其进行student 数据库的student2的表的stuno列的select操作授权; 答案:(2分)
grant select(stuno) on student.student2 to databasenormal@localhost; (5)查看mysql数据库下user表中该用户的所有信息;(2分)
答案: select * from user where User='databasenormal' (6)查看mysql数据库下table_priv表中该用户条目(2分) 答案: select * from tables_priv where User='databasenormal' ; (7)查看mysql数据库下columns_priv表中该用户条目(2分) 答案: select * from columns_priv where User='databasenormal' ;
出自
国家开放大学数据库运维 国家开放大学系统
河南大学
|
更多试题>>>>
1、1.仓库业务中,一个仓库数据库包括如下三张表:
仓库表warehouses(wid,name,area),wid是主键
零件表compnents(cid,name,mode,unit,price),cid为主键
组装表stores(w
2、使用truncate语句清空代理商表A中的数据,模拟误操作 (5分)利用(2)备份的数据文件,恢复代理商表A中的数据 (5分)
3、数据库CAP下有如下几张表:
顾客表:C(cid,cname,city,discnt)
商品表:P(pid,pname,city,quantity,price)
代理商表:A(aid,aname,city,pe
4、重新登录dbnormal账户并使用select语句查询student数据库的student2表中全部内容。(3分)
5、返回dbnormal账户使用select语句查看student数据库中student2表的信息,并查看所有权限。(3分)
|
|