Posted on

Start and kill process in Delphi

[code language=”pascal”]
var
PrIn: TProcessInformation;
StIn: TStartupInfo;
Res: bool;
ProcID, Process: Cardinal;

// start
begin
GetStartupInfo(StIn);
Res := CreateProcess(PChar(‘..\Project1.exe’),
PChar(‘"command line params"’), nil, nil, False, CREATE_NEW_PROCESS_GROUP,
nil, nil, StIn, PrIn);
ProcID := PrIn.hProcess;
Process := PrIn.dwProcessId;
end;

// kill
begin
TerminateProcess(ProcId, 0);
end;
[/code]

Posted on

MySQL, faq

my.ini
[mysqld]
# set basedir to your installation path
basedir=E:/mysql
# set datadir to the location of your data directory
datadir=E:/mydata/data
initialize
mysqld.exe –initialize

start

mysqld.exe --console

shutdown

mysqladmin -u root shutdown

connect in another cmd window

mysql.exe -u root -p password

change password

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';