var
MysqlStartupInfo:TStartupInfo;
MysqlProcessInfo:TProcessInformation;
MysqlPid: Integer;
begin
//ShellExecute(Self.handle,'open', PWideChar(edit_MysqlPath.Text + '\bin\mysqld.exe'),PWideChar('--defaults-file=my.ini'),'',SW_SHOWNORMAL);
FillChar(MysqlProcessInfo,sizeof(MysqlProcessInfo),0);
FillChar(MysqlStartupInfo,Sizeof(MysqlStartupInfo),0);
MysqlStartupInfo.cb:=Sizeof(MysqlStartupInfo);
MysqlStartupInfo.dwFlags:=STARTF_USESHOWWINDOW;
MysqlStartupInfo.wShowWindow:=SW_SHOW;
If CreateProcess(PWideChar(edit_MysqlPath.Text + '\bin\mysqld.exe'),PWideChar('"' + edit_MysqlPath.Text + '\bin\mysqld.exe' + '"' + ' --defaults-file=my.ini'),nil,nil,False,0,
nil,nil,MysqlStartupInfo,MysqlProcessInfo) then
begin
memo1.Lines.Add('[' + FormatdateTime('hh:nn:ss', Now)+ '] MYSQL数据库启动成功');
MysqlPid := MysqlProcessInfo.dwProcessId;
else
begin
memo1.Lines.Add('[' + FormatdateTime('hh:nn:ss', Now)+ '] MYSQL数据库启动失败,请检查相关配置');
end;
end;