• 2022-06-09
    请按照以下要求创建用户并授予权限。 [br][/br] 使用GRANT语句创建一个新的用户,用户名为user4、密码为123。 user4用户对所有数据库有INSERT、SELECT权限。 并使用WITH GRANT OPTION子句。 使用SELECT语句来查询user表中的用户权限
  • --创建用户,并授权 GRANT INSERT,SELECT ON *.* TO 'user4'@'localhost' IDENTIFIED BY '123' WITH GRANT OPTION; --查看权限 use mysql; SELECT Host,User,Password,Insert_priv,Select_priv, Grant_priv FROM mysql.user WHERE user='user4'\G

    举一反三

    内容

    • 0

      将查询SC表的权限授予用户U1,并允许该用户将此权限授予其他用户。实现该功能的 SQL语句是______。 A: A) GRANT SELECT TO SC U1 WITH PUBLIC B: B) GRANT SELECT ON SC TO U1 WITH PUBLIC C: C) GRANT SELECT TO SC ON U1 WITH GRANT OPTION D: D) GRANT SELECT ON SC TO U1 WITH GRANT OPTION

    • 1

      将查询关系S的权限授予用户WANG,并允许该用户将此权限授予给其他用户,实现此功能的SQL语句是( )。 A: GRANT SELECT TO S ON WANG WITH PUBLIC; B: GRANT SELECT ON S TO WANG WITH PUBLIC; C: GRANT SELECT TO S ON WANG WITH GRANT OPTION; D: GRANT SELECT ON S TO WANG WITH GRANT OPTION;

    • 2

      授予用户Jean可以查询帐户表account的权限,使用的SQL语句是(<br/>) A: GRANT<br/>SELECT ON account TO Jean B: GRANT<br/>SELECT TO Jean ON account C: GRANT<br/>SELECT TO account ON Jean D: GRANT<br/>SELECT ON Jean TO account

    • 3

      将查询SC表的权限授予用户U1,并允许该用户再将此权限授予其他用户。实现此功能的正确SQL语句是______。 A: GRANT SELECT TO TABLE SC ON U1 WITH PUBLIC B: GRANT SELECT ON TABLE SC TO U1 WITH PUBLIC C: GRANT SELECT TO TABLE SC ON U1 WITH GRANT OPTION D: GRANT SELECT ON TABLE SC TO U1 WITH GRANT OPTION

    • 4

      将Students表的查询权限授予用户U1和U2,并允许该用户将此权限授予其他用户。实现此功能的SQL语句是:()。 A: GRANT SELECT TO TABLE Students ON U1,U2 WITH PUBLIC; B: GRANT SELECT ON TABLE Students TO U1,U2 WITH PUBLIC; C: GRANT SELECT TO TABLE Students ON U1,U2 WITH GRANT OPTION; D: GRANT SELECT ON TABLE Students TO U1,U2 WITH GRANT OPTION;