安装前先停掉本地已有的mysql服务 https://dev.mysql.com/downloads/mysql/ 下载mysql压缩包解压 创建 my.init 文件
[mysqld]
port = 3307
basedir=F:\mysql-8.0.33-winx64\mysql-8.0.33-winx64
datadir=F:\mysql-8.0.33-winx64\mysql-8.0.33-winx64\data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
default-character-set=utf8
安装mysql服务 在bin目录下执行
mysqld install mysql2 --default-file= "F:\mysql-8.0.33-winx64\mysql-8.0.33-winx64\my.ini"
成功安装后会提示:
Service successfully installed
初始化数据库
mysqld --initialize
cmd regedit 打开注册表,修改数值数据如图所示 启动数据库服务
net start mysql2
修改密码