1.配置mysql安装目录的bin目录到path环境变量
2.拷贝my-default-ini,命名为my.ini
3.以管理员权限启动cmd.exe,切换到bin目录下以管理员权限启动cmd.exe 执行 mysqld install
结果 : Service successfully installed.2.再输入mysqld --initialize-insecure --user=mysql
(执行完上面命令后,MySQL会自建一个data文件夹,并且建好默认数据库,登录的用户名为root,密码为空)
3.my.ini文件配置
# These are commonly set, remove the # and set as required.
# basedir = D:\mysql-5.7.16-winx64
# datadir = D:\mysql-5.7.16-winx64\data
# port = 3306
# server_id = .....
服务启动成功