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

Install MySQL Service.bat

@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

@echo off

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

pause

Stop MySQL Service.bat

@echo off

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

pause

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/24/mysql-service-installation-and-startup-script-under-windows/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Windows下MySQL服务安装及启动脚本
Install MySQL Service.bat @echo off set mysql_home=D:/Server/MySQL/mysql-5.7.20-winx64 echo Installing MySQL5.7 Service... %mysql_home%/bin/mysqld ……
<<上一篇
下一篇>>
文章目录
关闭
目 录