midrange.com code scratchpad |
Name:
CL program to start MYSQL
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
01/04/2010 08:33:44 pm
|
IP:
Logged
|
|
Description:
Code to end the MYSQL daemon. This assumes that you are using the subsystem described here:
http://code.midrange.com/aa6f8aed17.html
and the startup method described here:
http://code.midrange.com/637d09aca2.html
|
Code:
- PGM
-
- DCL VAR(&USER) TYPE(*CHAR) LEN(20) VALUE('root')
- DCL VAR(&PASS) TYPE(*CHAR) LEN(20) VALUE('secretpassword')
-
- DCL VAR(&USERZ) TYPE(*CHAR) LEN(28)
- DCL VAR(&PASSZ) TYPE(*CHAR) LEN(32)
- DCL VAR(&BASE) TYPE(*CHAR) LEN(100)
- DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
-
- RTVDTAARA DTAARA(MYSQLBASE (1 100)) +
- RTNVAR(&BASE)
-
- CHGCURDIR DIR(&BASE)
-
- CHGVAR VAR(&USERZ) VALUE('--user=' *CAT &USER *TCAT &NULL)
- CHGVAR VAR(&PASSZ) VALUE('--password=' *CAT &PASS *TCAT &NULL)
-
- CALL QSYS/QP2SHELL ('bin/mysqladmin' &USERZ &PASSZ 'shutdown')
-
- ENDSBS MYSQL *IMMED
-
- ENDPGM
-
|
|
|