下载

https://dev.mysql.com/downloads/windows/installer/

  • Archives 可以选择历史版本
  • 能连接互联网的话,可以选择「在线安装版本」下载、安装
  • 内网环境无法连接互联网,选择离线版本,安装包文件大一些,下载、安装
image-20200622143421739

安装

选择安装类型

默认安装

image-20200622141613340

自定义安装「个人推荐」

image-20200715165952292 image-20200715170908505

检测环境

image-20200622143512948 image-20200622143559742 image-20200622143640164 image-20200622143709562 image-20200622143731214

安装

image-20200622143750525

产品配置

image-20200622144047267 image-20200622144140559 image-20200622144219982 image-20200622144309818 image-20200622144407295 image-20200622144518534 image-20200622144540121 image-20200622144607193 image-20200622144734742 image-20200622144757556

完成

image-20200622144822643

配置文件

文件路径 C:\ProgramData\MySQL\MySQL Server 8.0\my.ini

Data 目录

C:\ProgramData\MySQL\MySQL Server 8.0\Data

配置连接数、超时时间

1
2
3
4
5
6
7
8
9
10
11
# 修改最大连接数,默认最大连接数是 100
show variables like '%max_connections%'; # 查看最大连接数
show status like 'Max_used_connections'; # 同一时刻并行连接数的最大值
# 设置最大连接数为 1000 服务器重启后失效,修改配置文件,重启后生效
set global max_connections = 1000;
# 修改 /etc/my.cnf 或 my.ini 修改 max_connections = 1000 重启后生效 【重点】

# sleep 连接最大存活时间,默认是 28800 s ,8 小时,连接不会被清理
show global variables like '%wait_timeout';
# navicat 的超时请求机制配置了 240s,这里设置为 250s
set global wait_timeout=250; 【重点】

问题

This application requires NET Framework 4.5.2. Please install the NET Franework then run this installer again. For more information

下载并安装 NDP452-KB2901954-Web.exe

缺少组件,安装失败

VC_redist.x64