1

i try to initiale mysql under windows 10 64Bit with the command:

"D:\Test\Win32\Debug\mysqld.exe" --no-defaults --console --innodb-page-size=16384 --bootstrap "--lc-messages-dir=D:/Tests/Win32/Debug/share" --basedir=. --datadir=. --default-storage-engine=myisam --max_allowed_packet=9M --net-buffer-length=16k

The current directory is D:\Tests\Win32\Debug\data.

if i run the command from the shell, there is no problem. I have written a c++ program using embarcadero and an other using MVS 2013 with the code:

SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES)};
sa.bInheritHandle      = TRUE;
assert(CreatePipe(&m_ro, &m_wo, &sa, 0));
assert(SetHandleInformation(m_ro, HANDLE_FLAG_INHERIT, 0));
assert(SetHandleInformation(m_wo, HANDLE_FLAG_INHERIT, 0));
assert(CreatePipe(&m_ri, &m_wi, &sa, 0));
assert(SetHandleInformation(m_ri, HANDLE_FLAG_INHERIT, 0));
assert(SetHandleInformation(m_wi, HANDLE_FLAG_INHERIT, 0));

STARTUPINFOA si = {sizeof(STARTUPINFOA)};
si.dwFlags     |= STARTF_USESTDHANDLES;
si.hStdInput    = m_ri;
si.hStdOutput   = m_wo;
si.wShowWindow  = SW_SHOWMAXIMIZED | SW_SHOWNORMAL;

assert(CreateProcessA(ApplicationName, CommandLine, NULL, NULL, true, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &m_pi));

Mysqld.exe exits after printing an errror message : [Error] 1105 Bootstrap file error, return code (32). Nearest query: ''

I have use Mysql First and than MariaDb. Both write the same error message.

H.K
  • 173
  • 8

2 Answers2

0

You use --bootstrap parameter. You're supposed to write SQL script to stdin then, you do not. What are you trying to achieve, ultimately?

Vladislav Vaintroub
  • 5,308
  • 25
  • 31
0

I got the same problem that creating process with switches did not work in the same way in Borland as in command line.

I found a way around this by starting command line script instead of MySQL directly and have all the switches in the script... This is workaround that worked for me:

void Twin_main::server_on()
    {
    STARTUPINFO si;
    PROCESS_INFORMATION pi;
    SECURITY_ATTRIBUTES attr0,attr1;

    ZeroMemory(&si,sizeof(si));
    ZeroMemory(&pi,sizeof(pi));
    si.cb=sizeof(si);

    attr0.nLength=sizeof(SECURITY_ATTRIBUTES);
    attr0.bInheritHandle=TRUE;
    attr0.lpSecurityDescriptor=NULL;
    attr1=attr0;

    if (CreateProcess(NULL,"MySQL_start.cmd",&attr0,&attr1,TRUE,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi))
        {
        }
    }

Where MySQL_start.cmd is this:

cd ..\\MySQL Server 5.7.19
bin\mysqld --defaults-file="my.ini" --console

while placed in the same dir as my App exe and MySQL is one folder above:

[MySQL Server 5.7.19]
 [bin]
  mysqld.exe
[MyApp]
 MyApp.exe
 MySQL_start.cmd

So try to mimic that and then just rewrite the MySQL_start.cmd to match what you need...

Spektre
  • 49,595
  • 11
  • 110
  • 380