Files
pqs-9100_client/build/extraResources/mysql/stop.bat
2025-10-16 20:17:38 +08:00

39 lines
904 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 >nul
color 0C
title NPQS9100 MySQL Stop
cls
echo ==========================================
echo NPQS9100 MySQL 停止工具
echo ==========================================
echo.
set mypath=%cd%
echo 正在停止MySQL服务...
echo.
REM 方法1: 尝试使用mysqladmin关闭
echo [1/2] 尝试优雅关闭MySQL...
%mypath%\bin\mysqladmin.exe -u root -pnjcnpqs shutdown 2>nul
REM 等待2秒
timeout /t 2 /nobreak >nul
REM 方法2: 如果mysqladmin失败强制结束进程
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld.exe">NUL
if "%ERRORLEVEL%"=="0" (
echo [2/2] 强制停止MySQL进程...
taskkill /F /IM mysqld.exe >nul 2>&1
echo MySQL已强制停止
) else (
echo MySQL已经停止或未运行
)
echo.
echo ==========================================
echo MySQL已停止
echo ==========================================
echo.
pause