This is a Python-based command-line interface (CLI) tool for managing a portable MariaDB server for MSNoise. The tool allows you to download, extract, install, start, stop, create, and drop databases using MariaDB.
- Download and extract MariaDB portable version.
- Install/Setup MariaDB.
- Start MariaDB server in the background.
- Stop MariaDB server.
- Create a new database.
- Drop an existing database.
- Supports custom configurations for port, maximum connections, and large queries.
- Python 3.10 or above.
click
package: Install usingpip install click
.requests
package: Install usingpip install requests
.psutil
package: Install usingpip install psutil
.configobj
package: Install usingpip install configobj
.pooch
package: Install usingpip install pooch
.
-
Clone the repository:
git clone https://github.com/ROBelgium/msnoise-db.git cd msnoise-db
-
Install the required Python packages:
pip install click requests psutil configobj pooch
-
Install this package:
pip install -e .
Download and extract MariaDB portable version from a given URL.
msnoisedb download-and-extract C:/path/to/extract/to
Install MariaDB by specifying the port (default is 3307).
msnoisedb install-db
Start the MariaDB server in the background.
msnoisedb start-server
Stop the running MariaDB server.
msnoisedb stop-server
Create a new database.
msnoisedb create-database DATABASE_NAME
Drop an existing database.
msnoisedb drop-database DATABASE_NAME
You should set the MARIADB_DIR
environment variable to the path where MariaDB is extracted.
This avoids passing the directory path as an argument to each command.
Similarly, if you plan to use another port than the default (3307), you can set the MARIADB_PORT
environment variable.
set MARIADB_DIR=C:\path\to\extracted\mariadb
set MARIADB_PORT=9307
export MARIADB_DIR=/path/to/extracted/mariadb
export MARIADB_PORT=9307
The tool makes use of a custom configuration file named my_custom.cnf
to manage the MariaDB server settings.
The configuration file includes settings such as:
- Port number
skip-grant-tables
to allow any user to connect without a password.max_connections
to allow more than the default 10 connections.max_allowed_packet
to allow large query sizes.
[mysqld]
port=3307
skip-grant-tables
max_connections=100
max_allowed_packet=64M
- Security Warning: The
skip-grant-tables
option is included for development and debugging purposes, allowing any user to connect without authentication. This should not be used in a production environment. - Supported Platforms: The tool is designed to work on both Windows and Linux platforms.
This project is licensed under the EUPL License. See the LICENSE file for more details.