1.下载
https://downloads.mysql.com/archives/installer/
选择版本
https://downloads.mysql.com/archives/get/p/25/file/mysql-installer-web-community-5.7.30.0.msi
2.设置环境变量到path
D:\soft\mysql-5.7.30-winx64\bin
3.使用管理员运行cmd,跳转到D:\soft\mysql-5.7.30-winx64\bin
d:
cd D:\soft\mysql-5.7.30-winx64\bin
D:\soft\mysql-5.7.30-winx64\bin>mysqld --initialize-insecure --user=mysql
D:\soft\mysql-5.7.30-winx64\bin>mysqld -install
Service successfully installed.
D:\soft\mysql-5.7.30-winx64\bin>net start MySQL
4.登录设置密码
mysql -u root -p
第一次登录让输入密码时直接空格
set password=password(‘root’);