• 2022-06-08
    请按照以下要求写出相关授权的SQL语句。 使用SELECT语句查询user4表中的用户权限,结果如下: Host: localhost User: user4 Password: *23AE809DDACAF96AF0FD78ED04B6A265E05AA257 Insert_priv: Y Select_priv: Y Grant_priv: Y 1 row in set (0.05 sec) 要求如下: 写出使用GRANT语句实现相应授权的SQL语句(用户名为user4、密码为123) 写出使用SELECT语句查询user4表中的用户权限的SQL语句
  • --创建用户,并授权 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

      请写出收回user4用户的所有权限的REVOKE语句:【】。

    • 1

      以下语句哪个是正确的Select查询语句( ) A: select * from use B: select distinct username user; C: select * from user where ; D: select * from user username=’李四’;

    • 2

      使用CREATE USER语句创建一个新用户,用户名为user2、密码为123 下面选项中,能实现上述功能的语句是 A: CREATE USER 'user2'@'localhost' IDENTIFIED BY '123'; B: CREATE USER user2@localhost IDENTIFIED BY 123; C: CREATE USER 'user2'@'localhost' IDENTIFIED TO '123'; D: CREATE USER user2@localhost IDENTIFIED TO '123';

    • 3

      【多选题】下面语句可以实现查询user表中“zhangsan”的user,password,logins信息的是 A. select logins,user,password from user where name like ’%zhangsan%’; B. select user,password,logins, from user where name like ’zhangsan’; C. select password,logins,user from user where name=’zhangsan’ limit 1; D. select user,password,logins from user where name=’zhangsan’;

    • 4

      假定用户表user有多列,其中字段id中没有null值,字段username中存在null值。下面选项中,不能获得user表的总记录数的SQL语句是( ) A: select count(*) from user; B: select count(id) from user; C: select count(username) from user; D: select count(id) from user where1=1;