1.下载mysql压缩包并解压到无中文名称的路径下,配置环境变量(并重启系统,不重启服务的话第三步会报错)
2.在mysql目录下创建data文件夹
3.命令框进入到mysql的安装目录后执行 mysqld --initialize --console 语句,成功后的输出如下(会生成用户名和密码wh=7#oHegqCO )
2024-12-28T05:51:56.700917Z 0 [System] [MY-013169] [Server] D:\build_tools\mysql8\bin\mysqld.exe (mysqld 8.0.28) initializing of server in progress as process 9144
2024-12-28T05:51:56.850832Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-12-28T05:51:58.508291Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-12-28T05:52:01.530368Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: wh=7#oHegqCO
4.执行 mysqld -install , 打开命令框执行mysqld -install 时要使用管理员权限,否则会报错 install/remove of the service denied!