⚠️ Windows-only. Embedded/local use only. ⚠️ Ships MySQL 5.5 binaries for local embedded use ⚠️ Not intended for networked or production servers
Q2MySQL55_Win_Local_Server
A lightweight, embedded-style MySQL 5.5 server wrapper for Windows, bundled inside your Python package.
Ideal for desktop applications that require a private MySQL instance without requiring the user to install MySQL.
This library:
- Automatically finds
mysqld.exeandmysqladmin.exeinside the package - Initializes the data directory on first run
- Generates a minimal
my.ini - Starts MySQL in detached mode (does not block Python)
- Stops MySQL cleanly or forcefully
- Requires no admin rights
- Works only on Windows
✨ Features
- ✔️ Ships MySQL 5.5 internally
- ✔️ Auto-creates
my.ini - ✔️ Auto-initializes data directories (
mysql,performance_schema) - ✔️ Non-blocking background server start
- ✔️ Graceful stop using
mysqladmin - ✔️ No external installation required
📦 Package Structure
your_package/
mysql55_files/
bin/
mysqld.exe
mysqladmin.exe
data/
mysql/
performance_schema/
q2mysql55_win_local_server.py
🚀 Quick Start
from q2mysql55_win_local_server import Q2MySQL55_Win_Local_Server
DB_PATH = "test_mysql_data"
PORT = 3366
srv = Q2MySQL55_Win_Local_Server()
srv.start(PORT, DB_PATH)
print("Server started.")
# ... your logic ...
srv.stop()
print("Server stopped.")
⚙️ How It Works
1. Locating Binaries
The wrapper automatically resolves the folder mysql55_files using importlib.resources.
2. Data Directory Initialization
If missing, the following are copied from the embedded data/ directory:
mysql/performance_schema/
3. Configuration (my.ini)
A minimal config is created automatically in the data directory:
[mysqld]
port=...
basedir=...
datadir=...
character-set-server=utf8
default-storage-engine=myisam
skip-innodb
4. Starting the Server
Runs mysqld.exe in fully detached mode using:
DETACHED_PROCESSCREATE_NEW_PROCESS_GROUP
This allows the MySQL process to continue running independently.
5. Stopping the Server
Shutdown sequence:
mysqladmin --user=root --port=... shutdown- If server does not exit — terminate the process
- As a last resort — kill the process
⚠️ Requirements
- Windows 10 or later
- Python 3.9+
- Bundled MySQL 5.5 distribution in
mysql55_files
🔒 Security Notes
- The server uses root with no password — do not expose it to any external network.
- Intended only for local desktop applications.
📄 License
MIT
Metadata
Release files for q2mysql55-win-local 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| q2mysql55_win_local-0.1.9.tar.gz | 4.7 MB | Without provenance | Details for q2mysql55_win_local-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| q2mysql55_win_local-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for q2mysql55_win_local-0.1.9-py3-none-any.whl |
Total release size: 9.4 MB
Release files / q2mysql55_win_local-0.1.9.tar.gz
| Download URL | q2mysql55_win_local-0.1.9.tar.gz |
|---|---|
| Size | 4.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a260a6b2fa6dca8af29aef512e1dd1380789f9b246f2fa1c38e7f17d42ca154
|
|
BLAKE2b-256 checksum How to use checksums |
3ec5541dc3a542e3f725ac67d2142f19c01aecf4054443c4cbe3b23b6412d9e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / q2mysql55_win_local-0.1.9-py3-none-any.whl
| Download URL | q2mysql55_win_local-0.1.9-py3-none-any.whl |
|---|---|
| Size | 4.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1819f4b1069109a1a255c04ef9393ac73114cfff19120e081690445abba4fbbf
|
|
BLAKE2b-256 checksum How to use checksums |
fb8c9bf2390fdb927be0dbf821f36b60164dabcb7e42e7cd97dcb2956751cde5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for q2mysql55-win-local 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.