16 lines
358 B
Batchfile
16 lines
358 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
net session >nul 2>&1
|
|
if %errorLevel% == 0 (
|
|
goto :run_script
|
|
) else (
|
|
echo 请求管理员权限...
|
|
powershell -Command "Start-Process '%~f0' -Verb RunAs"
|
|
exit /b
|
|
)
|
|
|
|
:run_script
|
|
set "MYSQL_HOME=%~dp0"
|
|
nssm install mysqlgo "%MYSQL_HOME%bin\mysqld.exe" --defaults-file="my.ini" --console
|
|
nssm set mysqlgo AppDirectory %MYSQL_HOME% |