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

mysql-server-8-osx-x64

JSON →
library100.1.24jsnpmunverified

A Node.js package that provides a binary distribution of MySQL Server 8 for macOS x86 64-bit systems, allowing developers to spawn a MySQL server instance under the current user within an application directory. Version 100.1.24 is the current stable release, forked from mysql-server-5.6-osx-x64. It is platform-specific (OSX x64) and intended for local development environments. The package offers a simple API to start and stop the server, with configurable options. Only one instance can be spawned per application. Key differentiators: no system-wide installation required, runs user-scoped, and includes stop() method. Release cadence is infrequent.

npm install mysql-server-8-osx-x64
INSTALL
IMPORT
SIG · MYSQL-SERVER-8-OSX
M
mysql-server-8-osx-x64
databasejavascriptv100.1.24
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
✓ const startMysql = require('mysql-server-8-osx-x64');
✗ import startMysql from 'mysql-server-8-osx-x64';
This package uses CommonJS module system; no default ES module export.
startMysql
✓ import startMysql = require('mysql-server-8-osx-x64');
✗ import * as startMysql from 'mysql-server-8-osx-x64';
For TypeScript with CommonJS, use import = require pattern.
startMysql
✓ const startMysql = require('mysql-server-8-osx-x64');
✗ const { startMysql } = require('mysql-server-8-osx-x64');
The package exports a single function, not an object with named properties.

Demonstrates how to spawn a MySQL server instance with custom port, listen to stdout/stderr, and stop the server.

// Install: npm install mysql-server-8-osx-x64 const startMysql = require('mysql-server-8-osx-x64'); // Start a MySQL server on port 3307 const mysqld = startMysql({ port: 3307 }, { reinitialize: false }); mysqld.stdout.on('data', (data) => { console.log('stdout: ' + data); }); mysqld.stderr.on('data', (data) => { console.log('stderr: ' + data); }); mysqld.on('close', (code) => { console.log('child process exited with code ' + code); }); // Later, stop the server mysqld.stop();
Debug
Known issues
gotchaOnly one instance of MySQL server can be spawned per application process. Attempting to start multiple instances will result in an error.
fix
Ensure you stop the previous server (mysqld.stop()) before starting a new one, or design your application to use a single instance.
affects: >=1.0.0
gotchaThe package is platform-specific: it only works on macOS x86 64-bit. Installing on other OS or architectures will fail or produce a non-functional server.
fix
Use an alternative MySQL package for your platform (e.g., mysql-server for Linux or Windows).
affects: >=1.0.0
gotchaThe server runs under the current user, not as a system service. Ensure MySQL data directory permissions are correct to avoid write errors.
fix
Make sure the application user has write access to the data directory (defaults to './mysql-data' relative to cwd).
affects: >=1.0.0
breakingThe package name and versioning may have inconsistencies: package name is 'mysql-server-8-osx-x64' but version is 100.1.24 (not following semver). Importing via require('mysql-server-8-osx-x64') may break if package is not installed correctly.
fix
Double-check the package name and install exactly with 'npm install mysql-server-8-osx-x64'. Verify node_modules contains the correct module.
affects: 100.x
deprecatedThe package is a fork of older versions (5.6, 5.7) and may not receive updates for newer MySQL 8 versions or security patches.
fix
Consider using a more actively maintained MySQL Node.js library like 'mysql2' combined with a system-installed MySQL server, or a Docker container.
affects: >=1.0.0
Errors
Common errors & fixes
Error: spawn ENOENT
The MySQL binary (from the package) is missing or not executable, possibly due to incomplete installation or incompatible platform.
fix
Reinstall the package: npm install mysql-server-8-osx-x64 (ensure on macOS x64). If the error persists, check node_modules/mysql-server-8-osx-x64/bin for the mysqld binary.
Can't start server: only one instance allowed per application
Attempted to start a second MySQL instance without stopping the first one.
fix
Call mysqld.stop() on the existing instance before starting a new one.
Module not found: Can't resolve 'mysql-server-8-osx-x64'
The package is not installed in node_modules.
fix
Run npm install mysql-server-8-osx-x64 --save
Error: listen EADDRINUSE :::3306
The default port 3306 is already occupied by another MySQL service or application.
fix
Start the server with a different port, e.g., startMysql({ port: 3307 })
Upgrade
Version history
100.1.24latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
mysql-server-8-osx-x64 — npm install mysql-server-8-osx-x64 · libregistry