1.下载地址https://dev.mysql.com/downloads/mysql/ ,版本为
MySQL Community Server 5.7.28 (mysql-5.7.28-winx64.zip)
2.解压到指定目录D:Programsmysql-5.7.28-winx64,配置环境变量
MYSQL_HOME = D:Programsmysql-5.7.28-winx64
path添加%MYSQL_HOME%in
3.新建data目录,my.ini文件
my.ini 中输入内容 [mysqld] port = 3306 skip-grant-tables basedir=D:Programsmysql-5.7.28-winx64 datadir=D:Programsmysql-5.7.28-winx64data max_connections=200 character-set-server=utf8 default-storage-engine=INNODB sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysql] default-character-set=utf8
4.安装服务 进入cmd
(1)mysqld -install
(2)mysqld --initialize-insecure --user=mysql -- 初始化
(3)net start mysql
(4)mysqladmin -u root -p password 你的密码