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:
  1. PGM
  2.  
  3.    DCL VAR(&USER) TYPE(*CHAR) LEN(20) VALUE('root')
  4.    DCL VAR(&PASS) TYPE(*CHAR) LEN(20) VALUE('secretpassword')
  5.  
  6.    DCL VAR(&USERZ) TYPE(*CHAR) LEN(28)
  7.    DCL VAR(&PASSZ) TYPE(*CHAR) LEN(32)
  8.    DCL VAR(&BASE)  TYPE(*CHAR) LEN(100)
  9.    DCL VAR(&NULL)  TYPE(*CHAR) LEN(1) VALUE(X'00')
  10.  
  11.    RTVDTAARA  DTAARA(MYSQLBASE (1 100)) +
  12.               RTNVAR(&BASE)
  13.  
  14.    CHGCURDIR DIR(&BASE)
  15.  
  16.    CHGVAR VAR(&USERZ) VALUE('--user=' *CAT &USER *TCAT &NULL)
  17.    CHGVAR VAR(&PASSZ) VALUE('--password=' *CAT &PASS *TCAT &NULL)
  18.  
  19.    CALL QSYS/QP2SHELL ('bin/mysqladmin' &USERZ &PASSZ 'shutdown')
  20.  
  21.    ENDSBS MYSQL *IMMED
  22.  
  23. ENDPGM
  24.  
© 2004-2019 by midrange.com generated in 0.006s valid xhtml & css