Skip to content

Commit 72bfa67

Browse files
Merge pull request #140 from Sebastian-Webster/139-change-mysql-socket-to-be-named-pipe-name-on-windows
Socket parameter is now named pipe name if running on Windows
2 parents 5a2783c + 20a09b0 commit 72bfa67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libraries/Executor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class Executor {
7272
return new Promise(async (resolve, reject) => {
7373
await fsPromises.rm(logFile, {force: true})
7474

75-
const process = spawn(binaryFilepath, ['--no-defaults', `--port=${port}`, `--datadir=${datadir}`, `--mysqlx-port=${mySQLXPort}`, `--mysqlx-socket=${dbPath}/x.sock`, `--socket=${dbPath}/m.sock`, `--general-log-file=${logFile}`, '--general-log=1', `--init-file=${dbPath}/init.sql`, '--bind-address=127.0.0.1', '--innodb-doublewrite=OFF', '--mysqlx=FORCE', `--log-error=${errorLogFile}`, `--user=${os.userInfo().username}`], {signal: DBDestroySignal.signal, killSignal: 'SIGKILL'})
75+
const socket = os.platform() === 'win32' ? `MySQL-${crypto.randomUUID()}` : `${dbPath}/m.sock`
76+
const xSocket = os.platform() === 'win32' ? `MySQLX-${crypto.randomUUID()}` : `${dbPath}/x.sock`
77+
78+
const process = spawn(binaryFilepath, ['--no-defaults', `--port=${port}`, `--datadir=${datadir}`, `--mysqlx-port=${mySQLXPort}`, `--mysqlx-socket=${xSocket}`, `--socket=${socket}`, `--general-log-file=${logFile}`, '--general-log=1', `--init-file=${dbPath}/init.sql`, '--bind-address=127.0.0.1', '--innodb-doublewrite=OFF', '--mysqlx=FORCE', `--log-error=${errorLogFile}`, `--user=${os.userInfo().username}`], {signal: DBDestroySignal.signal, killSignal: 'SIGKILL'})
7679

7780
//resolveFunction is the function that will be called to resolve the promise that stops the database.
7881
//If resolveFunction is not undefined, the database has received a kill signal and data cleanup procedures should run.

0 commit comments

Comments
 (0)