建立用户(登录帐号)U1、U2、U3、U4、U5、U6、U7和对应的数据库学生课程系统的用户dbu1、dbu2、dbu3、dbu4、dbyu5、dbu6、dbu7。
时间: 2023-11-29 12:45:57 浏览: 345
DBu.rar_DBU
以下是建立用户和对应数据库用户的SQL语句:
```sql
-- 创建用户U1及对应的数据库用户dbu1
CREATE USER U1 IDENTIFIED BY password1;
CREATE USER dbu1 IDENTIFIED BY password1;
GRANT CONNECT TO dbu1;
GRANT SELECT ON Student TO dbu1;
-- 创建用户U2及对应的数据库用户dbu2
CREATE USER U2 IDENTIFIED BY password2;
CREATE USER dbu2 IDENTIFIED BY password2;
GRANT CONNECT TO dbu2;
GRANT INSERT, UPDATE, SELECT, DELETE ON Student TO dbu2;
GRANT INSERT, UPDATE, SELECT, DELETE ON Course TO dbu2;
-- 创建用户U3及对应的数据库用户dbu3
CREATE USER U3 IDENTIFIED BY password3;
CREATE USER dbu3 IDENTIFIED BY password3;
GRANT CONNECT TO dbu3;
GRANT INSERT, UPDATE, SELECT, DELETE ON Student TO dbu3;
GRANT INSERT, UPDATE, SELECT, DELETE ON Course TO dbu3;
-- 创建用户U4及对应的数据库用户dbu4
CREATE USER U4 IDENTIFIED BY password4;
CREATE USER dbu4 IDENTIFIED BY password4;
GRANT CONNECT TO dbu4;
-- 创建用户U5及对应的数据库用户dbu5
CREATE USER U5 IDENTIFIED BY password5;
CREATE USER dbu5 IDENTIFIED BY password5;
GRANT CONNECT TO dbu5;
-- 创建用户U6及对应的数据库用户dbu6
CREATE USER U6 IDENTIFIED BY password6;
CREATE USER dbu6 IDENTIFIED BY password6;
GRANT CONNECT TO dbu6;
-- 创建用户U7及对应的数据库用户dbu7
CREATE USER U7 IDENTIFIED BY password7;
CREATE USER dbu7 IDENTIFIED BY password7;
GRANT CONNECT TO dbu7;
```
阅读全文