Windows下MySQL服务安装及启动脚本

Install MySQL Service.bat

1
2
3
4
5
6
7
8
@echo off
set mysql_home=D:/Server/MySQL/mysql-5.7.20-winx64

echo Installing MySQL5.7 Service...
%mysql_home%/bin/mysqld --install "MySQL5.7" --defaults-file="%mysql_home%/my.ini"
%mysql_home%/bin/mysqld --initialize --user=mysql --console

pause

Start MySQL Service.bat

1
2
3
4
5
6
@echo off

echo Starting MySQL5.7 Service...
net start MySQL5.7

pause

Stop MySQL Service.bat

1
2
3
4
5
6
@echo off

echo Stoping MySQL5.7 Service...
net stop MySQL5.7

pause

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :