Mysql数据库:
部署mydql服务
安装:
[root@lgs ~]#yum install -y mariadb mariadb marisdb-devel mariadb-server
开启服务 :
[root@localhost ~]# systemctl restart mariadb
初始化Myqsl:
[root@lgs ~]#mysql_secure_installation
本地登录Mysql:
[root@localhost ~]#mysql -u root (-p密码)
>show databases;
>create database School;
>use School
>create table Score(
->ID int primary key
->Name varchar(20),
->Birthday Datetime,
->sex char(10),
->Password char(64)
->);
>insert into Score(ID,Birthday,sex,Password) //向表里添加内容
->values('1','suser1','1999-6-1','female','suser1'),
->('2','suser2','2000-9-1','male','suser2')
->;
>select * from Score order by id limit 0,2; //查询id列的前两行
>select * from Score; //查询score表中的内容
>select * from Score where ID='1'; //从score中删除ID等于1的内容
>drop table Score; //删除Score表
>drop database School; //删除Score库