1、在Windows系统下MYSQL的安装与使用
https://www.mysql.com/
https://dev.mysql.com/downloads/installer/
![](https://img-blog.csdnimg.cn/direct/34562690efb2474ba5dfd165e864d590.png)
![](https://img-blog.csdnimg.cn/direct/cac6a34888d642cbb83d5a8474157d50.png)
![](https://img-blog.csdnimg.cn/direct/a1eb6be98efa47578f8eba285d800353.png)
![](https://img-blog.csdnimg.cn/direct/b8ee00218ae84e3bb16d0b964dcb0ad8.png)
Development Computer :适合个人开发学习使用;
Server Computer: 主要用于 FTP,email,web 服务器等;
Dedicated Computer:用作 MySQL 服务器
![](https://img-blog.csdnimg.cn/direct/698486bfc3d74cb1a9cf2f9aacce73e8.png)
![](https://img-blog.csdnimg.cn/direct/2310c870f3eb414aaa62460a04de744e.png)
![](https://img-blog.csdnimg.cn/direct/02f3c62079104d9f9adf9249fa42dd56.png)
设置完后一直点next等待安装
下载好后打开os_utils文件修改"utf8mb4"并保存
进入命令
mysql -uroot -p
password:(在此输入mysql安装时设定的密码)
ALTER USER 'root'@'localhost' IDENTIFIED BY '新的密码';
2、创建一个英雄表(hero)
主键
name
nickname
address
groups
email
telphone
创建表hero
create table hero(
id int primary key auto_increment;
name varchar(50);
nickname varchar(50) not null;
address varchar(50);
`groups` varchar(50) check (`groups` in ('美军','南韩','志愿军'));
email varchar(255);
telephone int unique key;
);
insert into hero values(1,"MacArthur","五星上将","拉斯维加斯","美军","00000@qq.com" ,100);
insert into hero values(2,"李承晚","李","汉城","南韩","00001@qq.com" ,101);
insert into hero values(3,"彭德怀","彭老总","北京","志愿军","00002@qq.com" ,102);
insert into hero values(4,"洪学智","六星将军","北京","志愿军","00003@qq.com" ,103);
insert into hero values(5,"宋时轮","宋大将军","北京","志愿军","00004@qq.com" ,104);
desc hero;
select*from hero;