Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MySQL Memory Server

This package allows you to create ephemeral MySQL databases from JavaScript and/or TypeScript code and also the CLI, great for testing, CI, and learning MySQL. When creating a new database, if the version selected is not installed on the system, the binary is downloaded from MySQL's CDN (cdn.mysql.com)
This package allows you to create ephemeral MySQL databases from JavaScript and/or TypeScript code and also the CLI, great for testing, CI, and learning MySQL. When creating a new database, if the version selected is not installed on the system, the binary is downloaded from MySQL's CDN (cdn.mysql.com). This package supports Linux, macOS, and Windows.

You can run multiple MySQL databases with this package at the same time. Each database will use a random free port. The databases will automatically shutdown when the JS runtime process exits. A `stop()` method is also provided to stop each database instance.

Expand All @@ -11,25 +11,14 @@ Download with your package manager of choice. The package name is `mysql-memory-
#### Requirements

- Node.js >=16.6.0 or Bun >= 1.0.0
- macOS 13+, Windows, or Linux (This package is only tested on Ubuntu 20.04, 22.04, 24.04, and Fedora 40. Other Linux distributions may or may not work at this time.)

#### Requirements for downloaded MySQL versions

The following requirements only apply if you intend to have `mysql-memory-server` download a version of MySQL to use instead of using an already installed version of MySQL on the system:

Requirements for Windows:
- `Microsoft Visual C++ 2019 Redistributable Package` needs to be installed

Requirements for Linux:
- The `libaio1` or `libaio1t64` package needs to be installed
- If `libaio1` is not available but `libaio1t64` is, the `ldconfig` command needs to be available to run
- The `tar` package needs to be installed

#### Currently supported MySQL versions

- ```mysql-memory-server``` can run MySQL versions 5.7.19 and newer
- ```mysql-memory-server``` can download MySQL versions 5.7.19 - 9.2.0

Extra system requirements apply when ```mysql-memory-server``` is downloading MySQL instead of running a version of MySQL that is already installed on the system. To see the requirements and learn more about the supported versions for download, [read the doc](https://github.com/Sebastian-Webster/mysql-memory-server-nodejs/blob/v1.9.0/docs/SUPPORTED_MYSQL_DOWNLOADS.md)

## Example Usage - Application Code

This package supports both ESM and CJS so you can use import or require.
Expand Down
89 changes: 89 additions & 0 deletions docs/SUPPORTED_MYSQL_DOWNLOADS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Support for MySQL binary downloads

*Keep in mind that this information only applies to support provided by ```mysql-memory-server``` for versions of MySQL that it downloads from the MySQL CDN. This section <ins>does not apply</ins> to versions of MySQL that are already installed on your system.*

## Supported operating systems

- macOS
- Windows
- Linux

*```mysql-memory-server``` gets tested on Ubuntu 20.04, 22.04, 24.04, Fedora 40 and 41, macOS 13, 14, 15, and Windows Server 2019 and 2022. Linux distributions and Windows and macOS versions other than the ones tested may or may not work and are not guaranteed to work with this package.

## Binaries not available for download

- Versions 8.0.29, 8.0.38, 8.4.1, and 9.0.0 are not available for download for any operating systems as MySQL removed them from the CDN due to critical issues.

- Versions 5.7.32 - 5.7.44 are not available for download only for macOS systems as MySQL stopped supporting macOS Mojave starting from 5.7.32 for the rest of the 5.7.x line. As a result, those versions are not available for macOS in the MySQL CDN.

## Native Binary Architectures

*Architectures used can be overridden by the ```arch``` option provided your OS and system supports running applications that use those architectures.*

Linux, Windows, macOS x64: MySQL v5.7.19 - v9.2.0

Linux ARM64: MySQL v8.0.31 - v9.2.0

macOS ARM64: MySQL v8.0.26 - v9.2.0

Windows ARM64: N/A - Read about the ```arch``` option to run this package on your system

## Operating System Minimum Version Requirements

Windows - No documented minimum version

Linux - No documented minimum version

macOS:

| MySQL Version (inclusive) | macOS Minimum Version |
|--|--|
| v8.0.0 | OS X 10.9 (Mavericks) |
| v5.7.19 - v5.7.23 OR v8.0.1 - v8.0.3 OR v8.0.11 - v8.0.12 | macOS 10.12 (Sierra) |
| v5.7.24 - v5.7.29 OR v8.0.4 OR v8.0.13 - v8.0.18 | macOS 10.13 (High Sierra) |
| v5.7.30 - v5.7.31 OR v8.0.19 - v8.0.22 | macOS 10.14 (Mojave) |
| v8.0.23 - v8.0.27 | macOS 10.15 (Catalina) |
| v8.0.28 - v8.0.31 | macOS 11 (Big Sur) |
| v8.0.32 - v8.0.34 | macOS 12 (Monterey) |
| v8.0.35 - v8.0.39 OR v8.1.0 - v8.4.2 OR v9.0.1 | macOS 13 (Ventura) |
| v8.0.40 - v8.0.41 OR v8.4.3 - v8.4.4 OR v9.1.0 - v9.2.0 | macOS 14 (Sonoma) |

## Operating System Maximum Version Requirements

*The newest operating system you can run with x MySQL version*

Windows - No documented maximum version

macOS - No documented maximum version

Fedora Linux - No documented maximum version

Ubuntu Linux:

| MySQL version | Maximum Ubuntu Version |
|--|--|
| >= v8.0.4 | No documented maximum version |
| <= v8.0.3 | Ubuntu 23.10 |

## Required Dependencies

macOS - None

Windows:

| MySQL Version | Required Dependencies |
|--|--|
| <= v5.7.37 | Microsoft Visual C++ 2013 Redistributable Package |
| v5.7.38 & v5.7.39 | Microsoft Visual C++ 2013 Redistributable Package AND Microsoft Visual C++ 2019 Redistributable Package|
| >= v5.7.40 | Microsoft Visual C++ 2019 Redistributable Package |

Ubuntu Linux:

| Ubuntu Version | Required Dependencies |
|--|--|
| >= v24.04 | ```libaio1t64``` package, ```tar``` package, and ```ldconfig``` command |
| <= v23.10 | ```libaio1``` package and ```tar``` package |

Fedora Linux: ```libaio1``` package and ```tar``` package

*Document last updated in v1.9.0*
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export const MYSQL_MIN_OS_SUPPORT = {
'8.0.23 - 8.0.27': '19.0.0',
'8.0.28 - 8.0.31': '20.0.0',
'8.0.32 - 8.0.34': '21.0.0',
'8.0.35 - 8.0.39 || 8.1.0 - 8.4.2': '22.0.0',
'8.0.40 - 8.0.41 || 8.4.3 - 9.2.0': '23.0.0'
'8.0.35 - 8.0.39 || 8.1.0 - 8.4.2 || 9.0.1': '22.0.0',
'8.0.40 - 8.0.41 || 8.4.3 - 8.4.4 || 9.1.0 - 9.2.0': '23.0.0'
}
} as const;
export const DMR_MYSQL_VERSIONS = '8.0.0 - 8.0.2';
Expand Down
Loading