1、下载MySQL
![](https://img-blog.csdnimg.cn/img_convert/9f10e940f99a4a96ae6975c2de3b4020.png)
点击下载
![](https://img-blog.csdnimg.cn/img_convert/e272509744c24985b491dcecd7577294.png)
选择社区版
![](https://img-blog.csdnimg.cn/img_convert/9010972c659a4531b30f71826572da6e.png)
选择对应下载的操作系统类型,这里博主选择windows
![](https://img-blog.csdnimg.cn/img_convert/89d5ad1db3ec44cdabeb9840e5da6aed.png)
下载
![](https://img-blog.csdnimg.cn/img_convert/cdea98db3bb54314b90e199312693b2a.png)
![](https://img-blog.csdnimg.cn/img_convert/b26315cc708c4296af5f6b87356a6a07.png)
2、安装
双击msi文件,等待环境
![](https://img-blog.csdnimg.cn/img_convert/d2d56ac96ddb4b1bbbac8e4573904cfe.png)
默认开发环境
![](https://img-blog.csdnimg.cn/img_convert/c43277055d1f4dff8a801f533c983edc.png)
![](https://img-blog.csdnimg.cn/img_convert/2e781e59894845e19d367820f72be229.png)
![](https://img-blog.csdnimg.cn/img_convert/2b194ebd7e5f4b77bbacf3d84ccaca80.png)
点击execute,等待五分钟左右安装时间
![](https://img-blog.csdnimg.cn/img_convert/17576143d6ce43058075eea8fe9a4e3f.png)
![](https://img-blog.csdnimg.cn/img_convert/7f888f3e96b843e08098bc95733a3fb1.png)
![](https://img-blog.csdnimg.cn/img_convert/6e7b3241d36e4c38b2415be872f87492.png)
![](https://img-blog.csdnimg.cn/img_convert/a58e7c01a7b1464db4dcc65c07df8075.png)
![](https://img-blog.csdnimg.cn/img_convert/f90224e92e29488aa8488ee5a144c5c2.png)
设置密码,点击Next
![](https://img-blog.csdnimg.cn/img_convert/721b0fe421b649ce9fe0ae4e85204a02.png)
![](https://img-blog.csdnimg.cn/img_convert/abea51f40a254fe3ab9ceefea55dc28a.png)
![](https://img-blog.csdnimg.cn/img_convert/d17e74905a1b41af886ac27a320b0e7d.png)
等待execute
![](https://img-blog.csdnimg.cn/img_convert/9c9cdd5fe6724bafb4806a0e3c779739.png)
![](https://img-blog.csdnimg.cn/img_convert/51dc63c7771c4302b4bb38589c621439.png)
安装完成!
3、启动与停止
方式1:
Win+R打开运行,输入services.msc
![](https://img-blog.csdnimg.cn/img_convert/9cfd9d12b3794f9c80991c89770f19ae.png)
![](https://img-blog.csdnimg.cn/img_convert/7a2aba535ff64b37a116db58b06d5c63.png)
默认自动启动,右键可开启或关闭
![](https://img-blog.csdnimg.cn/img_convert/5f15c0c04e4441469076bb8db415d9d5.png)
方法2:
命令式启动:
启动:net start mysql80;//mysql80是对应着安装过程中windows的服务名
停止:net stop mysql80;
使用管理员身份运行
![](https://img-blog.csdnimg.cn/img_convert/553cb5b0c5724b17b57e32f8efa59876.png)
![](https://img-blog.csdnimg.cn/img_convert/9c029dba3273469da44af1cf38af86ae.png)
4、MySQL操作链接
方式1:
选择MySQL命令行客户端
![](https://img-blog.csdnimg.cn/img_convert/5b0872f481224151a81841d85d027df9.png)
输入密码
![](https://img-blog.csdnimg.cn/img_convert/b6810bf8232a4332a7ea708dfa328f1a.png)
![](https://img-blog.csdnimg.cn/img_convert/d26bbb4f2d7f43bb9dd8fb3acfea7802.png)
方式2:
使用windows自带的命令行工具执行(任意目录路径下执行命令,需要配置mysql的PATH环境变量)
命令:mysql [-h 127.0.0.1] [-P 3306] -u root -p
配置MySQL的PATH环境
![](https://img-blog.csdnimg.cn/img_convert/9bb5f2a906d44d8189b2ab4fe280303f.png)
找到环境变量
![](https://img-blog.csdnimg.cn/img_convert/4d7a52b1d85d43a0a8166cd59ba42a84.png)
添加path环境变量
![](https://img-blog.csdnimg.cn/img_convert/d9913a5a3fdb458296464e8d4820b676.png)
Mysql默认安装路径的:C:\Program Files\MySQL\MySQL Server 8.0\bin
![](https://img-blog.csdnimg.cn/img_convert/e02d33a50da04aa4b1eb8ac37456ac1a.png)
确定即可
![](https://img-blog.csdnimg.cn/img_convert/b3a30fe524ab43df914aef29c2eba5fc.png)
命令执行
![](https://img-blog.csdnimg.cn/img_convert/adee508728c041d9bd0cdac4035f7243.png)