1.创建数据库bdqn_个人名

       mysql -u root

       create database bdqn_lzh;

       use bdqn_lzh

1.MySQL数据库系统

2.创建包含姓名,性别,住址,成绩列表,表名为个人姓名,姓名为主键,住址不能为空 

       mysql> create table lizhanhua

    -> (xingming char(20) primary key,

    -> xingbie char(10),

    -> zhuzhi varchar(50) not null,

-> chengjiliebiao decimal(5,2));

1.MySQL数据库系统

3.个人表添加五条记录,添班级同学

       mysql> insert into lizhanhua values('fengyongqi','nan','shanxisheng','1');

       mysql> insert into lizhanhua values('gaoxin','nan','shanxisheng','88');

       mysql> insert into lizhanhua values('zhangzihang','nan','shanxisheng','90');

       mysql> insert into lizhanhua values('haohongqi','nan','shanxisheng','2');

       mysql> insert into lizhanhua values('cuitiantai','nan','shanxisheng','50');

1.MySQL数据库系统

4.查询表中成绩大于80分的同学

       mysql> select * from lizhanhua where chengjiliebiao>80;

1.MySQL数据库系统

5.授权你的同桌可以访问你的表

       mysql> grant select on auth.* to 'yongqi'@'localhost' identified by '123456';

       exit

       mysql -u yongqi -p

1.MySQL数据库系统

6.授予你自己可以修改和插入数据的权限

       exit

       mysql -u root

       grant insert,update on bdqn_lzh.lizhanhua to [email protected]

1.MySQL数据库系统

7.授予小明只能在192.168.1.0/24客户端上查询

       grant select on bdqn_lzh.lizhanhua to [email protected]'192.168.1.%';

       show grants for 'xiaoming'@'192.168.1.%';

1.MySQL数据库系统

相关文章:

  • 2021-08-30
  • 2022-01-15
  • 2021-08-30
  • 2021-06-16
  • 2022-01-05
  • 2021-11-20
  • 2021-08-02
猜你喜欢
  • 2021-08-30
  • 2021-11-22
  • 2021-11-17
  • 2021-09-04
  • 2022-01-15
相关资源
相似解决方案