mkdir /mnt/shufan
mount /dev/cdrom /mnt/shufan
ls /mnt/shufan
ls /etc/yum.repos.d/
rm -rf /etc/yum.repos.d/*.repo
yum-config-manager --add file:///mnt/shufan
yum clean all
yum repolist all
yum -y install httpd mariadb.x86_64 mariadb-server.x86_64
systemctl restart mariadb
systemctl status mariadb
创建表格:
员工信息表(employee),字段:员工号(eno)、姓名(ename)、性别(sex)、项目组(groups);
create database couman;
show databases;
use couman;
create table employee(eno varchar(10 ) not null,ename varchar(30) not null,sex int(5) default 0,groups varchar(20),primary key(eno));
create table score(scid int(10) not null auto_increment,eno varchar(10) not null,exid varchar(10) not null,score int(5),primary key (scid), constraint foreign key (exid) references exam(exid) , constraint foreign key (eno) references employee(eno));
考核内容表(exam),字段:内容序号(exid)、考核内容(cname);
create table exam(exid varchar(10) not null,exname varchar(50) not null,primary key(exid));
员工考核信息表(score,)字段:序号(scid)、员工号(eno)、内容序号(exid)、成绩(score)
create table score(scid int(10) not null auto_increment,eno varchar(10) not null,exid varchar(10) not null,score int(5),primary key (scid), constraint foreign key (exid) references exam(exid) , constraint foreign key (eno) references employee(eno));
插入数据
insert into employee (eno,ename,sex,groups) values(1001,'wangli',1,'dgroup01');
insert into employee (eno,ename,sex,groups) values(1002,'liuning',1,'dgroup01');