AG环亚娱乐_AG直营网_环亚娱乐AG最佳线路_搜狐新闻
web技术

热门文章

当前位置:主页 > 热门文章 >

联系我们

CONTACT

地址:
电话:
传真:
邮箱:

MYSQL注册启动及停用卸载批处理脚本(补)

2018-12-13

MYSQL注册启动及停用卸载批处理脚本(补)

早前调试mysql接口时候编写的批处理文件。

注册启动 my_install.bat

@echo off
set MYSQL_DIR=%~dp0
rem set MYSQL_DIR=%cd%

if not "%MYSQL_HOME%"=="" (
    if not "%MYSQL_HOME%"=="%MYSQL_DIR%" (
        echo MYSQL_HOME=%MYSQL_HOME% != MYSQL_DIR=%MYSQL_DIR%
        goto my_ends
    )
) else (
    set MYSQL_HOME=%MYSQL_DIR%
    echo MYSQL_HOME must be set as MYSQL_DIR=%MYSQL_DIR%
)

set PATH=%MYSQL_HOME%bin;%MYSQL_HOME%lib;%PATH%

mysqladmin -uroot  ping 1>nul 2>nul
@if "%ERRORLEVEL%" == "0" (
    echo Mysql is running.
    goto my_ends
)

echo "MYSQL_HOME = %MYSQL_HOME%"
echo Install and start mysql server ...

mysqld --install mysql_srv
sc config mysql_srv start= DEMAND
rem sc query mysql_srv
net start mysql_srv
rem sc query mysql_srv

mysqladmin -uroot  ping 1>nul 2>nul
@if "%ERRORLEVEL%" == "0" echo "Mysql started successfully"

:my_ends

cmd /K

停用卸载 my_uninstall.bat

@echo off
set MYSQL_DIR=%~dp0
rem set MYSQL_DIR=%cd%

if not "%MYSQL_HOME%"=="" (
    if not "%MYSQL_HOME%"=="%MYSQL_DIR%" (
        echo MYSQL_HOME=%MYSQL_HOME% != MYSQL_DIR=%MYSQL_DIR%
        goto my_ends
    )
) else set MYSQL_HOME=%MYSQL_DIR%

set PATH=%MYSQL_HOME%\bin;%MYSQL_HOME%\lib;%PATH%
echo "MYSQL_HOME = %MYSQL_HOME%"
echo Stop and uninstall mysql server ...

mysqladmin -uroot  ping  1>nul 2>nul
@if "%ERRORLEVEL%" == "0" (
    net stop mysql_srv
    rem sc query mysql_srv
)

mysqld --remove mysql_srv

:my_ends

pause



http://www.bkjia.com/Mysql/942474.htmlwww.bkjia.comtruehttp://www.bkjia.com/Mysql/942474.htmlTechArticleMYSQL注册启动及停用卸载批处理脚本(补) 早前调试mysql接口时候编写的批处理文件。 注册启动 my_install.bat @echo offset MYSQL_DIR=%~dp0rem set MYSQL_...

本文源自: AG环亚娱乐

Copyright © 2005-2017 http://www.turingvr.com AG环亚娱乐_AG直营网_环亚娱乐AG最佳线路_搜狐新闻版权所有

友情链接: