* add for running apache and mysql as service.

This commit is contained in:
shiyangyangwork@yahoo.cn
2012-03-01 06:23:43 +00:00
parent 14ca162696
commit c02e0f4810
4 changed files with 91 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
@echo off
if "%OS%" == "Windows_NT" goto WinNT
:Win9X
echo Don't be stupid! Win9x don't know Services
echo Please use apache_start.bat instead
goto exit
:WinNT
echo Installing Apache2.2 as an Service
bin\httpd -k install
echo Now we Start Apache2.2 :)
net start Apache2.2
:exit
pause
+18
View File
@@ -0,0 +1,18 @@
@echo off
if "%OS%" == "Windows_NT" goto WinNT
:Win9X
echo Don't be stupid! Win9x don't know Services
echo Please use apache_stop.bat instead
goto exit
:WinNT
echo Are you sure you wan't this?
echo now stopping Apache2.2 when it runs
net stop Apache2.2
echo Time to say good bye to Apache2.2 :(
bin\httpd -k uninstall
:exit
pause
+36
View File
@@ -0,0 +1,36 @@
@echo off
if "%OS%" == "Windows_NT" goto WinNT
:Win9X
echo Don't be stupid! Win9x don't know Services
echo Please use mysql_start.bat instead
goto exit
:WinNT
if exist %windir%\my.ini GOTO CopyINI
if exist c:\my.cnf GOTO CopyCNF
if not exist %windir%\my.ini GOTO MainNT
if not exist c:\my.cnf GOTO MainNT
:CopyINI
echo Safe the %windir%\my.ini as %windir%\my.ini.old!
copy %windir%\my.ini /-y %windir%\my.ini.old
del %windir%\my.ini
GOTO WinNT
:CopyCNF
echo Safe the c:\my.cnf as c:\my.cnf.old!
copy c:\my.cnf /-y c:\my.cnf.old
del c:\my.cnf
GOTO WinNT
:MainNT
echo Installing MySQL as an Service
copy "%cd%\bin\my.cnf" /-y %windir%\my.ini
bin\mysqld --install mysql --defaults-file="%cd%\bin\my.ini"
echo Try to start the MySQL deamon as service ...
net start MySQL
:exit
pause
+20
View File
@@ -0,0 +1,20 @@
@echo off
if "%OS%" == "Windows_NT" goto WinNT
:Win9X
echo Don't be stupid! Win9x don't know Services
echo Please use mysql_stop.bat instead
goto exit
:WinNT
echo now stopping MySQL when it runs
net stop mysql
echo Uninstalling MySql-Service
bin\mysqld.exe --remove mysql
if not exist %windir%\my.ini GOTO exit
echo Remove %windir%\my.ini
del %windir%\my.ini
:exit
pause