mariadb-connector-python-install

Installs and configures the MariaDB Connector/Python mariadb PyPI module across 1.1 and 2.0 lines.

28|115|Updated Jan 28, 2025
One-click install
npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-python-install-mariadb-corporation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mariadb-connector-python-install
Source: https://github.com/mariadb-corporation/mariadb-docs/tree/main/agent-skills/granular/connectors/mariadb-connector-python-install
Command: npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-python-install-mariadb-corporation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Installing the mariadb Python module fails or misbehaves when the wrong install variant is chosen: the 1.1 GA line always builds the C extension and needs MariaDB Connector/C 3.3.1+ with mariadb_config on the PATH, while the pure-Python, binary-wheel, and pooling variants exist only on the 2.0 line and require pip install --pre. This Skill prevents build failures, container runtime errors, and insecure TLS defaults. ## Core Features & Use Cases - Correct install variant selection: Distinguishes 1.1 GA (pip install mariadb) from 2.0 RC variants (mariadb[c], mariadb[binary], mariadb[pool]), including Python floor requirements (3.8 vs 3.10) and Windows guidance. - Build failure diagnosis: Explains that mariadb_config not found means the Connector/C development package (libmariadb-dev or MariaDB-devel) is missing, not the compiler, and how to point at it via site.cfg. - Configuration guidance: Covers option files (default_file, default_group), TLS settings including the 1.1 ssl_verify_cert=False default, and ConnectionPool sizing. - Use Case: When building a slim Docker image where import mariadb fails at runtime, this Skill directs you to install libmariadb3 in the final stage or use the 2.0 mariadb[binary] wheel that bundles Connector/C. ## Quick Start Ask the AI to install and configure the MariaDB Connector/Python module for your environment, for example by requesting the correct pip command and Connector/C prerequisites for a Debian container targeting the stable release.

Frequently Asked Questions about mariadb-connector-python-install

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install MariaDB Connector/Python with pip?▼

Run pip install mariadb to get the stable 1.1 GA line, which always builds the C extension and needs MariaDB Connector/C 3.3.1 or later installed first. For the 2.0 line, use pip install --pre mariadb with optional [c], [binary], or [pool] extras.

Why does pip install mariadb fail with mariadb_config not found?▼

The mariadb_config tool ships with the Connector/C development package, not the compiler. Install libmariadb-dev on Debian or Ubuntu, or MariaDB-devel on RHEL, Rocky, or SLES, and ensure it is on the PATH or set its path in site.cfg.

What is the difference between mariadb 1.1 and 2.0 install variants?▼

Version 1.1 is the GA line with one install that always builds the C extension and includes pooling. Version 2.0 is a release candidate offering pure-Python, C extension, and binary wheel variants, with pooling as a separate [pool] extra, all requiring pip install --pre.

Does the mariadb Python module read ~/.my.cnf automatically?▼

No, option files are not read by default. Pass default_file (a path or an empty string for standard locations) or default_group to mariadb.connect() to enable option-file reading; explicit connect() arguments override option-file values.

Does MariaDB Connector/Python verify TLS server certificates by default?▼

On the 1.1 line, ssl_verify_cert defaults to False, so connections are encrypted but the server is unauthenticated unless you pass ssl_verify_cert=True. Since 2.0 the default flips to True.

Why does import mariadb fail in a Docker container after a successful build?▼

A source install needs Connector/C development files at build time and the runtime library afterwards. In a multi-stage image, install libmariadb3 or MariaDB-shared in the final stage, or use the 2.0 mariadb[binary] wheel which bundles Connector/C.