用户user1创建了一张表tab1,现在想让用户user2能插入数据到表tab1,请补齐赋予user2权限的语句。grant insert on to user2;
举一反三
- 使用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';
- 下面使用DELETE语句删除用户user2的语句中,正确的是 A: DELETE FROM mysql.user WHERE Host='localhost' AND User='user2'; B: DELETE FROM mysql.user WHILE Host='localhost' AND User='user2'; C: DELETE FROM mysql.user WHERE Host='localhost' OR User='user2'; D: DELETE FROM mysql.user WHILE Host='localhost' OR User='user2';
- 【单选题】把对Student表的全部操作权授予用户User1和User2的语句是(1.0分) A. GRANT All ON Student TO User1, User2; B. GRANT Student ON All TO User1, User2; C. GRANT All TO Student ON User1, User2; D. GRANT All TO User1, User2 ON Student;
- 使用GRANT语句创建用户名为user1、密码为123,并授予该用户对chapter08.student表有查询权限。 下面选项中,能实现上述功能的语句是 A: GRANT SELECT ON chapter08.student FOR 'user1'@'localhost' IDENTIFIED BY '123'; B: GRANT USER SELECT ON chapter08.student TO 'user1'@'localhost' IDENTIFIED BY '123'; C: GRANT USER SELECT ON chapter08.student 'user1'@'localhost' IDENTIFIED BY '123'; D: GRANT SELECT ON chapter08.student TO 'user1'@'localhost' IDENTIFIED BY '123';
- 下列选项中,采用不指定表的字段名的方式向表user中添加id为2,name为”小明”的记录,正确的SQL语句是 A: INSERT INTO user(“id”,”name”) VALUES(2,”小明”); B: INSERT INTO user VALUE(2,”小明”); C: INSERT INTO user VALUES(2,’小明’); D: INSERT INTO user(id,name) VALUES(2,’小明’);