1. 搜索mysql
2. 下载,点击https://www.mysql.com/downloads/
3. 解压后进入bin目录D:\program\mysql-8.0.11-winx64\bin
4. 初始化数据库得到data目录
mysqld --initialize-insecure
5. 配置 my.imi文件,D:\program\mysql-8.0.11-winx64
[mysql]
default-character-set=utf8
[mysqld]
port = 3306
basedir=D:\program\mysql-8.0.11-winx64
datadir=D:\program\mysql-8.0.11-winx64\data
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
6. 添加服务
mysqld -install
7. 登录数据库并修改密码
mysql -u root -p
修改root 密码
set password = password('新密码');