1.下载并解压

下载地址:https://www.oaroad.com/download/mysql-5.7.25-winx64.zip

2.配置环境变量

变量名:MYSQL_HOME
变量值:D:\MySQL
变量名:path
变量值:%MYSQL_HOME\bin%

3.初始化MySQL

以管理员身份运行cmd
进入到D:\MySQL\bin
执行命令:mysqld --initialize-insecure --user=mysql

 4.安装MySQL

执行命令:mysqld -install

 5.启动服务

执行命令:net start MySQL

6.登录MySQL,设置密码

mysql -u root -p 
mysql> alter user "root"@"localhost" identified by "123456";
mysql> flush privileges;  
mysql> exit;