Registry / database / mysql-server-5.7-osx-x64

mysql-server-5.7-osx-x64

JSON →
library100.0.8jsnpmunverified

A Node.js wrapper that downloads and spawns MySQL Server 5.7 for macOS 64-bit as a child process. Version 100.0.8 is the latest, but this package is essentially a legacy binary distribution pinned to MySQL 5.7. It provides a single function to start the MySQL server with configurable options (port, reinitialize) and returns a ChildProcess with a stop() method. Only one instance per application is supported. Useful for local development/testing without a full MySQL installation. However, it is macOS-only and unmaintained since MySQL 8.x.

npm install mysql-server-5.7-osx-x64
INSTALL
IMPORT
SIG · MYSQL-SERVER-5.7-O
M
mysql-server-5.7-osx-x64
databasejavascriptv100.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

startMysql
var starMysql = require('mysql-server-5.7-osx-x64');
import startMysql from 'mysql-server-5.7-osx-x64';
The package does not support ES modules; use CommonJS require(). The default export is a function.
ChildProcess
var mysqld = require('mysql-server-5.7-osx-x64')();
var mysqld = new (require('mysql-server-5.7-osx-x64'))();
startMysql() returns a ChildProcess instance directly, not a constructor.
mysql2
const mysql = require('mysql2'); const connection = mysql.createConnection({...});
const mysql = require('mysql');
To connect to the spawned MySQL server, use mysql2 (or mysql) package. The package only spawns the server, not the client.

Demonstrates starting a MySQL 5.7 server on port 3307 and stopping it.

var startMysql = require('mysql-server-5.7-osx-x64'); var mysqld = startMysql({ port: 3307 }, { reinitialize: false }); mysqld.stdout.on('data', function (data) { console.log('stdout: ' + data); }); mysqld.stderr.on('data', function (data) { console.log('stderr: ' + data); }); mysqld.on('close', function (code) { console.log('child process exited with code ' + code); }); // Later on, stop server... mysqld.stop();
Debug
Known issues
deprecatedThis package is a fork of an older package and is not maintained. MySQL 5.7 is end-of-life since October 2023.
fix
Use a modern MySQL server package (e.g., mysql-server-8.0-osx-x64) or install MySQL via Homebrew.
affects: >=0
gotchaOnly one instance of the MySQL server can be spawned per application. Calling startMysql() a second time will fail silently or cause conflicts.
fix
Ensure startMysql() is only called once per process.
affects: >=0
gotchaThe package name requires exact architecture: 'osx-x64'. It will not work on Apple Silicon (ARM) Macs without Rosetta.
fix
Use a package that supports ARM or install MySQL via Homebrew.
affects: >=0
breakingThe default export is not a class constructor; calling with 'new' will cause a TypeError.
fix
Call startMysql() as a plain function, not as a constructor.
affects: >=0
Errors
Common errors & fixes
Error: spawn mysql-server-5.7-osx-x64 ENOENT
The package binary is not installed or the environment lacks the necessary permissions.
fix
Run 'npm install' in the project directory to ensure the binary is downloaded. Also, ensure you are on macOS 64-bit.
TypeError: startMysql is not a constructor
Attempting to use 'new' on the exported function.
fix
Replace 'new startMysql()' with 'startMysql()'.
Error: Only one instance of MySQL server can be spawned per application
Calling startMysql() more than once in the same process.
fix
Refactor to call startMysql() only once.
Upgrade
Version history
100.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mysql-server-5.7-osx-x64 — npm install mysql-server-5.7-osx-x64 · libregistry