怎么用已经创建的账号连接服务器

  1. 使用SDB数据库中的student表。
    (1)创建本地机角色student。

(2)授予角色student查询student表的权限。

(3)创建本地机用户账号st_02,密码为123。

(4)授予用户账号st_02角色student的权限。

(5)以用户账号st_02连接MySQL服务器,查看student表信息。

(6)撤消用户账号st_02角色student的权限。

(7)删除角色student。

1.CREATE role 'student'@'localhost';
2. grant select on Student to student;
3.CREATE USER 'st_02'@'localhost' IDENTIFIED BY '123';
4.grant student to st_02;
5.mysql -ust_02 -p123; use SDB;select * from student;
6.revoke student from st_02;
7.drop role student;