mariadb-corporation/mariadb-dev
MariaDB skills and the native mariadb-shell MCP server for Hermes Agent.
MariaDB aggregate functions — calculations across a set of rows (typically with GROUP BY or as window functions via OVER()). Covers counting (COUNT, COUNT(DISTINCT)), totals/averages (SUM, AVG), extrema (MIN, MAX), string aggregation (GROUP_CONCAT with DISTINCT/ORDER BY/SEPARATOR/LIMIT), bitwise aggregation (BIT_AND, BIT_OR, BIT_XOR), and the statistical family (STD/STDDEV/STDDEV_POP, STDDEV_SAMP, VARIANCE/VAR_POP, VAR_SAMP). Use when summarizing or rolling up rows in MariaDB. Note aggregates skip NULLs, GROUP_CONCAT silently truncates at group_concat_max_len, and ONLY_FULL_GROUP_BY is not in the default sql_mode.
MariaDB-specific syntax and behavior for ALTER TABLE — online DDL with ALGORITHM (DEFAULT/COPY/INPLACE/NOCOPY/INSTANT) and LOCK clauses, ALTER ONLINE TABLE shorthand, WAIT/NOWAIT lock timeouts, IF EXISTS/IF NOT EXISTS on subclauses, ADD/DROP SYSTEM VERSIONING, ADD PERIOD FOR, DROP CONSTRAINT, FORCE rebuild, CONVERT PARTITION/TABLE, DISCARD/IMPORT TABLESPACE, atomic ALTER, two-phase replication. Use when writing, generating, or reviewing ALTER TABLE statements that target MariaDB, or planning schema migrations against MariaDB.
MariaDB-specific syntax and behavior for ALTER USER and SET PASSWORD — IF EXISTS warning-not-error semantics, IDENTIFIED BY vs IDENTIFIED BY PASSWORD vs IDENTIFIED VIA/WITH multi-plugin auth, PASSWORD EXPIRE variants and default_password_lifetime interaction, ACCOUNT LOCK/UNLOCK, resource limits, TLS/REQUIRE options, and SET PASSWORD's three literal forms (PASSWORD(), OLD_PASSWORD(), pre-hashed string — there is no cleartext-string form). Use when writing, generating, or reviewing statements that create/change account credentials, expire or lock accounts, or set passwords on MariaDB.
MariaDB-specific behavior of the mariadb-binlog utility — that decoded row events (-v/-vv) are commented pseudo-SQL riding alongside the still-executable base64 BINLOG blob (not a replacement for it), that ANNOTATE_ROWS original-SQL comments are a MariaDB-only event printed by default, that --flashback generates MariaDB-specific reverse/undo SQL for DML only, --disable-log-bin to avoid re-logging on replay, and that replay means piping into the mariadb client, never running the tool itself. Use when writing, generating, or reviewing commands that read, filter, or replay MariaDB binary logs.
MariaDB-specific syntax and behavior for CALL — optional parentheses when a procedure takes no arguments, OUT/INOUT parameters that must bind to user-defined variables, procedures returning result sets directly to the client (unlike stored functions), the EXECUTE privilege requirement, CALL as a prepared statement, and max_sp_recursion_depth for recursive procedures. Use when writing, generating, or reviewing CALL statements that invoke MariaDB stored procedures.
MariaDB-specific behavior of the mariadb command-line client — batch mode auto-enables silent/tab output, \G/\g and client-side DELIMITER for stored-routine bodies, --safe-updates sets max_join_size (no sql_ prefix) not sql_max_join_size, default charset auto-detects from locale rather than defaulting to latin1, and mysql is a kept symlink for the same binary. Use when writing, generating, or reviewing shell commands, scripts, or docs that invoke the mariadb CLI.
Installing and configuring MariaDB Connector/C, the C client library the other MariaDB connectors build on — the runtime and development package names per distribution (libmariadb3/libmariadb-dev, MariaDB-shared/MariaDB-devel), how to get compile and link flags from mariadb_config or pkg-config libmariadb rather than hardcoding them, the build-from-source prerequisites, and the configuration side: that the library reads option files only when the application asks for them via MYSQL_READ_DEFAULT_FILE or MYSQL_READ_DEFAULT_GROUP, which option groups it reads, how !includedir and unknown options differ from the server, and which TLS options depend on the library it was built against. Use when installing, building, packaging, or configuring Connector/C.
MariaDB-specific behavior of MariaDB Connector/C (the libmariadb client library implementing the MariaDB client-server protocol in C) for application code — that the public API is still mysql_-prefixed (mysql_init, mysql_real_connect, mysql_query, ...) with only a few mariadb_-prefixed extensions; that mysql_init() must precede mysql_real_connect(), with mysql_optionsv() options set in between; the buffered-vs-unbuffered split between mysql_store_result() and mysql_use_result() plus the mandatory mysql_free_result(); that literals need mysql_real_escape_string() when not using prepared statements; the ?-placeholder prepared-statement API (MYSQL_BIND arrays, mysql_stmt_bind_param/execute/fetch); and that autocommit is ON by default so transactions need mysql_autocommit(conn,0). Use when writing or reviewing C code that talks to MariaDB via Connector/C (libmariadb).
Installing and configuring MariaDB Connector/C++ — that MariaDB Connector/C is a hard prerequisite on Linux and must be installed first (3.1.1 or later for Connector/C++ 1.0, 3.3.3 or later for 1.1), while the Windows MSI brings it along; that Connector/C++ is downloaded per platform rather than pulled from the server package repository; that the binary tarball install is manual and easy to leave half-done, with the authentication plugin directory the piece most often missed; that the library is -lmariadbcpp and the public header is mariadb/conncpp.hpp; and that the build requires C++11. Use when installing, building, packaging, linking, or troubleshooting the setup of MariaDB Connector/C++.
MariaDB-specific behavior of MariaDB Connector/C++ (the sql:: namespace API, modeled on JDBC 4.0) for application code — that a driver comes from sql::mariadb::get_driver_instance() and connections from driver->connect(url, props), returning a raw Connection* you must own; that the URL is jdbc:mariadb://host:port/database[?opt=val]; that PreparedStatement parameter indexes and ResultSet column indexes are 1-based, not 0-based; that ? is the only placeholder; that ResultSet::next() must be called before the first read; that the API returns raw pointers with no automatic cleanup — wrap them in std::unique_ptr or close() explicitly, child before parent; that sql::SQLString is the parameter/return type throughout; that autocommit defaults to true; that errors surface as sql::SQLException; and that it is built on Connector/C. Use when writing or reviewing C++ code that talks to MariaDB via Connector/C++ (the sql:: API).
Installing and configuring MariaDB Connector/J, the JDBC driver for MariaDB — the Maven and Gradle coordinates org.mariadb.jdbc:mariadb-java-client, the driver class org.mariadb.jdbc.Driver, and the Java version each release series supports; that the 3.x lines accept only the jdbc:mariadb: URL scheme unless permitMysqlScheme is set; that JNA is not a transitive dependency and must be added by the application before Unix domain sockets or Windows named pipes will work; and the TLS configuration, where sslMode defaults to disabled so encryption has to be requested explicitly, then tuned with serverSslCert, truststores, and keystores. Use when adding the driver to a build, wiring a datasource, or configuring TLS.
MariaDB-specific behavior of MariaDB Connector/J (the org.mariadb.jdbc:mariadb-java-client JDBC driver) for application code — that JDBC 4 auto-registers the driver so Class.forName is unneeded; that the URL scheme is jdbc:mariadb://host:port/db?opts (jdbc:mysql: needs permitMysqlScheme); that useServerPrepStmts defaults to false, so PreparedStatement substitutes parameters client-side; that batched INSERTs use the COM_STMT_BULK protocol by default and getGeneratedKeys() then returns all generated ids, one per row, not a single id; that autocommit defaults to true so transactions need setAutoCommit(false); that setFetchSize(Integer.MIN_VALUE) throws (fetch size must be >= 0); that pooling should use MariaDbPoolDataSource or an external pool; and that failover uses multi-host URLs, not driver code. Use when writing or reviewing Java code that talks to MariaDB with the mariadb-java-client JDBC driver.
Installing and configuring MariaDB Connector/Node.js (the mariadb npm package) — that it is pure JavaScript with no native build step, so no compiler or node-gyp is involved; that the 3.5 line requires Node.js 20 or later; that the default export is the promise API and the callback API lives behind the mariadb/callback subpath, with both ESM and CommonJS resolved through the package's exports map and TypeScript typings already bundled; that ssl: true verifies the server certificate by default and a private CA needs an object form; and the pool defaults, connectionLimit 10 and acquireTimeout 10 seconds. Use when adding the connector to a project, containerizing it, or configuring TLS and pooling.
MariaDB-specific behavior of MariaDB Connector/Node.js (the mariadb npm package, a non-blocking driver) for application code — that the Promise API is default, with the Callback API under require('mariadb/callback'); that ? positional placeholders are default and :name style needs namedPlaceholders; that BIGINT and insertId return native BigInt unless bigIntAsNumber/insertIdAsNumber are set; that batch() uses the bulk protocol instead of looping query(); that queryStream() is needed for large results since query() buffers everything in memory; that pool.getConnection() needs a release() in a finally; that autocommit follows the server default (ON) so transactions need explicit beginTransaction()/commit()/rollback(); and that execute() uses server-side prepared statements while query() uses the text protocol. Use when writing or reviewing Node.js code that talks to MariaDB with the mariadb package.
Installing and configuring MariaDB Connector/ODBC — that a driver manager (unixODBC on Linux, iODBC on macOS, the built-in manager on Windows) is a prerequisite and the driver has to be registered with it in odbcinst.ini before any DSN or DRIVER= connection string resolves; that the driver's own bitness must match the driver manager's; where odbcinst, ODBCSYSINI, ODBCINI, and ODBCINSTINI put the configuration; that the canonical DSN keywords are UID and PWD with USER and PASSWORD as synonyms; and the TLS keywords SSLCA, SSLVERIFY, FORCETLS, and TLSVERSION. Use when installing the driver, writing an odbcinst.ini or odbc.ini entry, building a connection string, or diagnosing a data source that will not connect.
MariaDB-specific behavior of MariaDB Connector/ODBC (the ODBC 3.8-compliant driver built on MariaDB Connector/C) for application code — that the DSN-less keyword is DRIVER={MariaDB ODBC 3.2 Driver} on Windows, or a registered driver name / .so path on Linux and macOS; that parameter markers are always the positional ? via SQLBindParameter, never named; that one Unicode (SQLWCHAR) driver binary serves both ANSI and Unicode apps via SQL_ATTR_ANSI_APP; that SQLPrepare+SQLExecute uses server-side prepared statements (binary protocol) while SQLExecDirect defaults to client-side text unless EDSERVER is set; that autocommit is ON by default so transactional code must switch SQL_ATTR_AUTOCOMMIT off; and that TLS turns on implicitly when any of SSLCA/SSLCERT/SSLKEY is set. Use when writing or reviewing application code (C/C++, or via a wrapper like pyodbc) that talks to MariaDB through the ODBC API.
Installing and configuring MariaDB Connector/Python (the mariadb PyPI module) — that a plain pip install mariadb gets the 1.1 GA line, which always builds the C extension and so needs MariaDB Connector/C 3.3.1 or later with mariadb_config on the PATH; that the pure-Python, binary-wheel and pooling variants exist only on the 2.0 line and need pip install --pre mariadb[...]; that pooling is built in on 1.1 but a separate [pool] extra on 2.0; the Python floor (3.8 on 1.1, 3.10 on 2.0); that option files are read only when default_file or default_group is passed; and that ssl_verify_cert defaults to off on 1.1. Use when installing, packaging, containerizing, or configuring the mariadb module, or when diagnosing a failed build or connection setup.
MariaDB-specific behavior of MariaDB Connector/Python (the mariadb PyPI module, a PEP-249 / DB API 2.0 driver) for application code — that the default paramstyle is qmark (?), not format (%s), and styles must not be mixed; that string formatting must never build SQL; that autocommit is off by default so DML needs conn.commit(); that a single parameter needs a one-tuple (v,); that the text protocol is default and binary=True switches to server-side prepared statements; that cursors are buffered by default; connection pooling via ConnectionPool (default size 5, max 64); callproc() for stored procedures; and the DB API exception hierarchy under mariadb.Error. Use when writing or reviewing Python code that talks to MariaDB with the mariadb module.
Installing and configuring MariaDB Connector/R2DBC, the reactive non-blocking driver for MariaDB — the Maven coordinates org.mariadb:r2dbc-mariadb, the fact that it implements R2DBC rather than JDBC so connections come from ConnectionFactories.get() with an r2dbc:mariadb:// URL and never from DriverManager; that connection pooling is a separate io.r2dbc:r2dbc-pool dependency rather than a built-in; that sslMode defaults to disabled so TLS must be requested explicitly and then tuned with serverSslCert or a truststore; and the parameter names that differ from the JDBC driver, notably username and socket. Use when adding the driver to a build, wiring a ConnectionFactory, or configuring pooling and TLS.
MariaDB-specific behavior of MariaDB Connector/R2DBC (the org.mariadb:r2dbc-mariadb reactive driver implementing the R2DBC SPI) for application code — that the URL scheme is r2dbc:mariadb://user:pw@host:port/db and factories come from ConnectionFactories.get(url) or a MariadbConnectionConfiguration builder; that placeholders are positional ? bound 0-indexed or named :name; that NOTHING runs until the Publisher returned by Statement.execute() is subscribed, and a Result can be consumed exactly once; that bindNull(index, Class) needs an explicit type; that autocommit defaults to true and useServerPrepStmts to false; that transactions return Mono<Void> that must itself be subscribed; that pooling is not built in and needs r2dbc-pool; and that errors arrive as onError signals (R2dbcException), not thrown exceptions. Use when writing or reviewing Java code that talks to MariaDB reactively via R2DBC.
MariaDB control-flow functions and operators — IF(), IFNULL()/NVL(), NULLIF(), COALESCE(), the CASE operator (simple and searched forms), NVL2(), and DECODE/DECODE_ORACLE. Use when writing SQL that branches on a condition, substitutes for NULL, or matches a value against a list of alternatives in MariaDB.
MariaDB-specific syntax and behavior for databases — CREATE DATABASE / CREATE SCHEMA (exact synonyms), the OR REPLACE data-loss footgun vs IF NOT EXISTS, CHARACTER SET / COLLATE / COMMENT specifications and the utf8mb4 default-charset change, ALTER DATABASE (charset/collate/comment + UPGRADE DATA DIRECTORY NAME), DROP DATABASE, and the absence of a RENAME DATABASE statement. Use when writing, generating, or reviewing CREATE DATABASE / ALTER DATABASE / DROP DATABASE statements that target MariaDB.
MariaDB-specific syntax and behavior for CREATE FUNCTION across its three distinct forms — stored functions (RETURNS + RETURN, IN/OUT/INOUT parameters, DETERMINISTIC/binlog interaction), stored aggregate functions (CREATE AGGREGATE FUNCTION with FETCH GROUP NEXT ROW), and loadable user-defined functions (CREATE FUNCTION ... SONAME 'lib.so', a plugin_dir-loaded shared library unrelated to stored routines). Use when writing, generating, or reviewing any CREATE FUNCTION statement, a custom aggregate, or a UDF registration targeting MariaDB.
MariaDB-specific syntax and behavior for CREATE INDEX / DROP INDEX — that it maps to ALTER TABLE (batch multiple adds), can't create a PRIMARY KEY, needs a prefix length on TEXT/BLOB columns, has no expression/functional indexes (index a generated column instead), real descending indexes (since 10.8), IGNORED indexes for safe optimizer testing, UNIQUE/FULLTEXT/SPATIAL/VECTOR kinds, USING BTREE/HASH/RTREE, CREATE OR REPLACE / IF NOT EXISTS, KEY_BLOCK_SIZE being ignored here, and dropping a PRIMARY KEY via DROP INDEX PRIMARY. Use when writing, generating, or reviewing CREATE INDEX / DROP INDEX statements that target MariaDB.
MariaDB-specific syntax and behavior for CREATE PROCEDURE — OR REPLACE / IF NOT EXISTS (mutually exclusive), DEFINER and SQL SECURITY DEFINER/INVOKER, parameter modes IN/OUT/INOUT (plus IN OUT and NOCOPY in Oracle mode only), parameter DEFAULT values (11.8+), the CONTAINS SQL/NO SQL/READS SQL DATA/MODIFIES SQL DATA characteristics (advisory, default CONTAINS SQL), DETERMINISTIC being a no-op on procedures, required CREATE ROUTINE privilege plus automatic ALTER ROUTINE/EXECUTE grants, and the client-side DELIMITER convention. Use when writing, generating, or reviewing CREATE PROCEDURE statements or stored-procedure bodies that target MariaDB.
MariaDB-specific syntax and behavior for CREATE SEQUENCE — sequences are ordinary tables (any transactional engine, default BIGINT SIGNED) wrapped with sequence semantics, support atomic CREATE OR REPLACE / IF NOT EXISTS, default to CACHE 1000, expose ANSI (NEXT VALUE FOR), PostgreSQL (NEXTVAL()), and Oracle-mode (seq.nextval) access forms, special-case INCREMENT BY 0 for multi-master/Galera replication, require row-based binlogging, and (since 11.5) truncate rather than reject out-of-range MINVALUE/MAXVALUE/START literals. Use when writing, generating, or reviewing CREATE SEQUENCE statements that target MariaDB.
MariaDB-specific syntax and behavior for CREATE TABLE — atomic CREATE OR REPLACE, INVISIBLE / COMPRESSED columns, system-versioned and application-time PERIOD clauses, IGNORED indexes, table-level encryption, page compression, sequence and Aria table options, and the utf8/utf8mb4 trap. Use when writing, generating, or reviewing CREATE TABLE statements that target MariaDB.
MariaDB-specific syntax and behavior for CREATE TRIGGER — OR REPLACE, DEFINER, IF NOT EXISTS, multiple trigger_events in one statement with INSERTING/UPDATING/DELETING predicates (since 12.0), multiple triggers per action-time/event ordered with FOLLOWS/PRECEDES, OLD/NEW row-reference rules, the no-ALTER-TRIGGER gotcha, and restrictions on modifying tables already touched by the firing statement. Use when writing, generating, or reviewing CREATE TRIGGER statements that target MariaDB.
MariaDB-specific syntax and behavior for CREATE USER — multiple authentication methods chained with OR, IDENTIFIED BY / IDENTIFIED BY PASSWORD / IDENTIFIED VIA|WITH plugin USING|AS 'string'|PASSWORD(...), the default authentication plugin, REQUIRE TLS options, WITH resource-limit options, PASSWORD EXPIRE variants, ACCOUNT LOCK/UNLOCK, OR REPLACE, IF NOT EXISTS, and account-name/host defaulting. Covers CREATE USER only (not GRANT's implicit user-creation path). Use when writing, generating, or reviewing CREATE USER statements that target MariaDB.
MariaDB-specific syntax and behavior for views — CREATE OR REPLACE VIEW vs CREATE VIEW IF NOT EXISTS (mutually exclusive), ALGORITHM = UNDEFINED/MERGE/TEMPTABLE and its effect on updatability and performance, the SQL SECURITY DEFINER default, WITH CASCADED/LOCAL CHECK OPTION, what makes a view updatable/insertable, frozen-at-creation definitions, and ALTER VIEW / DROP VIEW. Use when writing, generating, or reviewing CREATE VIEW / ALTER VIEW / DROP VIEW statements that target MariaDB.
MariaDB date and time functions — current time (NOW, CURRENT_TIMESTAMP, SYSDATE, CURDATE, CURTIME, UTC_TIMESTAMP/UTC_DATE/UTC_TIME), arithmetic (DATE_ADD, DATE_SUB, ADDDATE, SUBDATE, INTERVAL units), differences (TIMESTAMPDIFF, TIMESTAMPADD, DATEDIFF, TIMEDIFF), extraction (EXTRACT, YEAR/MONTH/DAY/HOUR/MINUTE/SECOND/MICROSECOND, QUARTER, WEEK, DAYOFWEEK, WEEKDAY, LAST_DAY), parsing/formatting (STR_TO_DATE, DATE_FORMAT, GET_FORMAT), Unix time (UNIX_TIMESTAMP, FROM_UNIXTIME), time-zone conversion (CONVERT_TZ), construction (MAKEDATE, MAKETIME, SEC_TO_TIME), and Oracle-compat helpers (ADD_MONTHS, MONTHS_BETWEEN, TO_DATE). Use when computing, parsing, formatting, or converting dates, times, and timestamps in MariaDB.
MariaDB-specific syntax and behavior for DELETE — RETURNING deleted rows in one statement, both multi-table forms (DELETE … FROM and DELETE FROM … USING) with ORDER BY/LIMIT (since 11.8), single-table ORDER BY/LIMIT/PARTITION/alias/index hints, DELETE HISTORY for system-versioned tables, FOR PORTION OF for application-time periods, QUICK/LOW_PRIORITY/IGNORE modifiers and their engine limits, deleting from a table referenced in its own subquery, and DELETE-vs-TRUNCATE differences. Use when writing, generating, or reviewing DELETE statements that target MariaDB.
MariaDB-specific syntax and behavior for DROP TABLE — RESTRICT/CASCADE being no-ops, the DROP TEMPORARY TABLE guard against dropping a same-named base table, partial drops in a multi-table statement, IF EXISTS warning behavior, failure when a table is referenced by a foreign key, DROP TABLE on a view, automatic trigger removal, implicit-commit (and the DROP TEMPORARY exception), WAIT/NOWAIT, and CREATE OR REPLACE TABLE as the atomic replace. Use when writing, generating, or reviewing DROP TABLE statements that target MariaDB.
MariaDB-specific behavior for DROP USER and RENAME USER — multiple accounts per statement, IF EXISTS turning a missing-user error into a note, the active-connections warning (dropped users keep working until their session ends; new connections are blocked), no cascade onto objects owned or privileges granted by the dropped user, dangling DEFINER references left behind on views/routines/triggers, and RENAME USER preserving privileges across the rename with no active-session check. Use when writing, generating, or reviewing DROP USER or RENAME USER statements, or account-lifecycle cleanup scripts, that target MariaDB.
MariaDB-specific behavior of the mariadb-dump client for dev workflows (seeding, fixtures, schema snapshots, consistent backups) — why --single-transaction is the live-InnoDB flag and its limits, that --routines/--events are off by default while --triggers is on, --extended-insert vs diffable dumps, schema-only/data-only, --replace/--insert-ignore for idempotent seeding, that plain dbname omits CREATE DATABASE, restoring by piping into the mariadb client, and that the replication-coordinate flags are --master-data/--dump-slave (not --source-data/--dump-replica). Use when invoking or reviewing mariadb-dump commands.
MariaDB encryption, hashing, and compression functions — AES_ENCRYPT/AES_DECRYPT keyed off block_encryption_mode (default aes-128-ecb) with optional IV/mode since 11.2; SHA2/SHA1/MD5 checksums; KDF and RANDOM_BYTES for key derivation; COMPRESS/UNCOMPRESS/UNCOMPRESSED_LENGTH; PASSWORD/OLD_PASSWORD/ENCRYPT for auth hashing; ENCODE/DECODE (weak, not removed) vs DES_ENCRYPT/DES_DECRYPT (removed in 13.0). Use when writing SQL that encrypts, hashes, derives keys from, or compresses data in MariaDB.
MariaDB-specific behavior of EXPLAIN and its relatives (ANALYZE, EXPLAIN FORMAT=JSON, SHOW EXPLAIN/ANALYZE FOR) — MariaDB has no EXPLAIN ANALYZE; it uses a standalone ANALYZE <statement> that actually executes the query (and, for UPDATE/DELETE/INSERT, actually writes); plain EXPLAIN never runs anything; only FORMAT=JSON/TRADITIONAL exist (no TREE); and EXPLAIN covers INSERT/REPLACE directly. Use when writing, generating, or reviewing query-plan/EXPLAIN statements that target MariaDB.
MariaDB-specific features and capabilities that go beyond standard MySQL. Use when evaluating MariaDB, optimizing an existing MariaDB application, reviewing code or schema for MariaDB improvements, asking what MariaDB can do that other databases cannot, or migrating from Oracle to MariaDB. Also use when the user asks what could be improved in how a codebase uses MariaDB, or asks about MariaDB advantages over MySQL or PostgreSQL.
MariaDB-specific GRANT behavior — privilege scope levels (global/db/table/column/routine), implicit account creation interacting with the NO_AUTO_CREATE_USER sql_mode (on by default), MariaDB-only privileges LLMs won't know (BINLOG MONITOR, DELETE HISTORY, SET USER, FEDERATED ADMIN, READ_ONLY ADMIN, etc.) and the SUPER-privilege split, GRANT PROXY, resource limits, REQUIRE TLS options, and MariaDB roles (GRANT role TO user/role, WITH ADMIN OPTION, single-active-role semantics). Use when writing, generating, or reviewing GRANT statements or privilege/role designs that target MariaDB.
MariaDB-specific behavior of the mariadb-import client — a command-line wrapper around LOAD DATA INFILE for bulk-loading text files. Covers the table-name-from-filename rule, TAB (not CSV) defaults, the --local vs server-side fork, --replace/--ignore, --columns vs --ignore-lines, --parallel and its --lock-tables interaction, and the locale-autodetected charset. Use when invoking or reviewing mariadb-import commands, or scripting bulk CSV/TSV imports into MariaDB.
MariaDB information functions — session and server metadata: LAST_INSERT_ID, ROW_COUNT, FOUND_ROWS, DATABASE/SCHEMA, USER/CURRENT_USER/SESSION_USER/SYSTEM_USER, CURRENT_ROLE, VERSION, CONNECTION_ID, CHARSET, COLLATION, COERCIBILITY, BENCHMARK, DEFAULT, LAST_VALUE, ROWNUM, BINLOG_GTID_POS, DECODE_HISTOGRAM. Use when writing SQL that reads auto-increment IDs, affected/found row counts, the current database or authenticated user, the server version, or connection/session metadata in MariaDB.
MariaDB-specific syntax and behavior for INSERT — RETURNING to get inserted rows in one round trip, INSERT … ON DUPLICATE KEY UPDATE with VALUE()/VALUES(), INSERT IGNORE warning and error-coercion behavior, INSERT … SELECT, the SET form, PARTITION targeting, multi-row VALUES, priority/DELAYED modifiers and their engine limits, and LAST_INSERT_ID() semantics after multi-row inserts. Use when writing, generating, or reviewing INSERT statements that target MariaDB, or when an upsert is needed.
MariaDB JSON functions — complete catalog of JSON_*, JSON_ARRAY/OBJECT constructors and aggregates (JSON_ARRAYAGG, JSON_OBJECTAGG), extraction (JSON_EXTRACT, JSON_VALUE, JSON_QUERY, JSON_TABLE, ->, ->>), modification (JSON_SET, JSON_INSERT, JSON_REPLACE, JSON_REMOVE, JSON_ARRAY_APPEND, JSON_ARRAY_INSERT), merge variants (JSON_MERGE, JSON_MERGE_PATCH, JSON_MERGE_PRESERVE), validation (JSON_VALID, JSON_SCHEMA_VALID, IS JSON), introspection (JSON_TYPE, JSON_DEPTH, JSON_LENGTH, JSON_KEYS, JSON_CONTAINS, JSON_EQUALS), formatting (JSON_DETAILED/PRETTY, JSON_COMPACT, JSON_LOOSE, JSON_QUOTE, JSON_UNQUOTE), and JSON_TABLE for relational projection. Use when writing SQL that constructs, queries, or modifies JSON data in MariaDB.
Use MariaDB Vector as the store behind Laravel's AI SDK (laravel/ai): generating embeddings, persisting them in a MariaDB vector column, semantic search and giving an agent a similarity-search tool. Use when building RAG, semantic search or agent memory on MariaDB in a Laravel application.
Connect a Laravel (PHP) application to MariaDB: PDO requirements, the dedicated mariadb driver, version support and Docker/Sail setup. Use when setting up, configuring or debugging a MariaDB connection in a Laravel or PHP application.
MariaDB Vector in a Laravel (PHP) application: vector columns, VECTOR INDEX, the AsVector Eloquent cast and similarity search with the query builder. Use when building semantic search, RAG or embedding storage on MariaDB with Laravel or Eloquent.
MariaDB-specific syntax and behavior for LOAD DATA [LOCAL] INFILE (and LOAD XML) — the LOCAL vs server-side fork and its security/privilege requirements (local_infile, FILE privilege, secure_file_priv), tab/newline (not CSV) defaults, how LOCAL silently downgrades duplicate handling to IGNORE and disables strict-mode aborts, IGNORE n LINES, user-variable + SET transformation, the CHARACTER SET clause, and priority/concurrency. Use when writing, generating, or reviewing LOAD DATA / LOAD XML statements, or bulk-loading CSV/TSV/XML into MariaDB.
MariaDB explicit table locking (LOCK TABLES / UNLOCK TABLES: READ, READ LOCAL, WRITE, LOW_PRIORITY WRITE, WRITE CONCURRENT, WAIT n/NOWAIT) and the named user-level lock functions GET_LOCK, RELEASE_LOCK, RELEASE_ALL_LOCKS, IS_FREE_LOCK, IS_USED_LOCK — including the alias-matching trap, the implicit-commit interaction with transactions, and multi-lock-per-connection semantics since 10.0.2. Use when writing or reviewing code that takes explicit table locks, implements application-level mutexes/advisory locks, or debugs 'was not locked with LOCK TABLES' / lock-wait-timeout errors.
Overview and entry point for migrating a MySQL database to MariaDB with the migrator.* tools of the mariadb-shell MCP server — what the tooling is, the two things you may never choose (unconfigured connections, passwords), the resume-safe trap that reports success while migrating nothing, the four tools, and the discover → mode → configure → run → verify workflow. Use when asked to migrate/move/port a MySQL database or schema to MariaDB, when asked to migrate from MySQL (target may be left unstated — assume MariaDB), to configure or run the MySQL-to-MariaDB migration tooling, or when a migration run failed and has to be diagnosed or resumed; then read the focused sub-skill for the step you are on.
Write the MySQL-to-MariaDB migrator's config/migration.yaml with migrator.set_config — the rules that get a configuration refused (every named account must be a configured MCP connection, SRC_PORT/TGT_PORT always explicit, no password key ever, string values only), the keys each mode requires, the useful optional keys, and what MIGRATE_APP_USERS does to accounts and grants. Use when configuring a migration, when set_config was refused, when a password or app-user migration needs setting up, or when correcting a configuration with merge=True. Read mariadb-migrator first for the tools and preconditions.
Turn a bare MySQL-to-MariaDB migration request into something runnable — call db.list_connections, probe and present source and target in one table, list the migratable schemas, and know when a fully-specified request may go straight to run and when a name that matches no configured connection is a hard stop. Use when a migration is asked for without a source, target, schema or mode named, when deciding what to ask before configuring a migration, or when the names in the prompt do not appear in db.list_connections. Read mariadb-migrator first for the tools and preconditions.
The MySQL-to-MariaDB migration modes and the gate each one brings — one_step (serial streaming), two_step (parallel, needs mariadb-mtk and only retries within a run), staged (dump to disk with a SHA-256 manifest, STAGED_PHASE dump_only/load_only across sessions, needs bash 4), binlog (replication, MySQL 8.0+ and no JSON columns), and why inplace/replace_slave are never picked. Use when choosing or recommending a migration mode, when mariadb-mtk or SQLINESDATA_BIN is missing, when splitting a staged dump and load, or when asked for a low-downtime MySQL-to-MariaDB cutover. Read mariadb-migrator first for the tools and preconditions.
Execute a MySQL-to-MariaDB migration with migrator.plan, migrator.run and migrator.resume — always plan first, omit out on a new run so a stale state.json cannot report every step SKIPPED at exit 0, check a finished run three ways (succeeded, every step DONE, the data actually on the target), read report.json/run.log in the artifacts directory, and hold the source baseline instead of publishing an interim report. Use when starting, timing out, resuming or diagnosing a migration run, or when a run reported success but nothing moved. Read mariadb-migrator first for the tools and preconditions.
The MySQL-to-MariaDB migrator's known defects and failure playbook — the bash 3.2 traps (unbound SRC_SSL_ARGS, exit 143 without pv, declare -A in staged mode), the SHOW PACKAGE STATUS 1064 that is a mariadb-dump age problem and not a MySQL 8.4 one, the root-user and existing-target-DB refusals, option-file contamination, and what every refusal message from set_config/plan/run/resume means and what to set. Use when a migration was refused, a run failed or timed out, every step reported SKIPPED, or an error message from the migrator tools has to be diagnosed. Read mariadb-migrator first for the tools and preconditions.
Verify a finished MySQL-to-MariaDB migration on the target with the db.* tools and report it — object counts per type, foreign keys, row counts and value spot-checks (never a checksum unless asked), authenticating as each migrated account, the four things that vanish silently through MySQL's /*!80016*/ version gates (CHECK NOT ENFORCED, SRID, DEFAULT ENCRYPTION, utf8mb4_0900 collations), and the fixed markdown comparison table — one per database, real pipes, nothing added when every check comes back clean. Use when a migration run has finished and its result has to be checked or reported, or when asked whether a migration really succeeded. Read mariadb-migrator first for the tools and preconditions.
MariaDB numeric and math functions — rounding/truncation (ROUND, the TRUNCATE function vs the TRUNCATE TABLE statement, FLOOR, CEILING, SIGN, ABS), integer-vs-decimal division (the DIV operator vs /, MOD / %), powers and logs (POW/POWER, SQRT, EXP, LN, LOG, LOG2, LOG10), trigonometry (SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2, COT, PI, DEGREES, RADIANS), randomness (RAND, seeded RAND(N)), base conversion (CONV, OCT, BIN, HEX), checksums (CRC32, CRC32C), and number formatting (FORMAT). Use when writing SQL that does arithmetic, rounding, base conversion, or random sampling in MariaDB — especially where exact-vs-approximate types or division-by-zero behavior matter.
MariaDB-specific behavior of server-side prepared statements — PREPARE / EXECUTE / DEALLOCATE PREPARE and EXECUTE IMMEDIATE — covers the broad preparable-statement allow-list, EXECUTE..USING accepting arbitrary expressions (not just user variables), the stored-function/trigger ban on dynamic SQL, session-local statement lifetime, and EXECUTE IMMEDIATE's DEFAULT/IGNORE bind parameters. Use when writing, generating, or reviewing PREPARE/EXECUTE statements that target MariaDB.
Best practices for query optimization in MariaDB — indexing strategies, EXPLAIN analysis, pagination, histogram statistics, and MariaDB-specific optimizer settings. Use when diagnosing slow queries, designing indexes, reviewing schema or query performance, or when queries involve large tables, pagination, GROUP BY, or ORDER BY. Also use when the user asks about MariaDB query performance, EXPLAIN output, or optimizer behavior.
MariaDB-specific syntax and behavior for RENAME TABLE — atomic multi-table renames executed left-to-right with full rollback on any failure (enabling the classic swap trick), works directly on TEMPORARY tables (no ALTER TABLE needed), refuses to run inside an active transaction or under LOCK TABLES, requires ALTER+DROP on the source and CREATE+INSERT on the target, supports IF EXISTS and WAIT/NOWAIT, and has specific cross-database move restrictions for views and tables with triggers. Use when writing, generating, or reviewing RENAME TABLE statements that target MariaDB.
MariaDB-specific syntax and behavior for REPLACE — why REPLACE is DELETE-then-INSERT (not an upsert/UPDATE), when it triggers (PRIMARY/UNIQUE conflicts only), its data-loss footguns (unlisted columns reset to DEFAULT, AUTO_INCREMENT burned, ON DELETE cascades and DELETE+INSERT triggers fired), the INSERT … ON DUPLICATE KEY UPDATE alternative, REPLACE … RETURNING, the SET and SELECT forms, PARTITION targeting, and the INSERT+DELETE privilege requirement. Use when writing, generating, or reviewing REPLACE statements, or when an upsert is being considered.
Set up authentication and authorization for a MariaDB REST Service — create a REST AUTH APP (MRS, MARIADB or OAuth2 vendor), link it to a service, add REST users, and control access with REST roles and GRANT/REVOKE REST CREATE/READ/UPDATE/DELETE privileges at service/schema/object level. Use when asked to require login on REST endpoints, create auth apps or REST users, or manage REST roles and permissions on MariaDB.
Create a MariaDB REST Service for a database schema — configure the REST metadata schema, create the REST service, add a REST schema, and expose tables/views as REST data mapping views and stored procedures/functions as REST procedures/functions. Use when asked to REST-enable a MariaDB schema, publish tables/views/routines over HTTP, or write CREATE REST SERVICE / SCHEMA / VIEW / PROCEDURE / FUNCTION DDL.
Remove MariaDB REST Service objects with DROP REST statements — drop a REST service, schema, data mapping view, procedure, function, content set/file, auth app, user, role or stale REST Daemon registration, using IF EXISTS to avoid errors. Use when asked to delete, remove, tear down or clean up existing REST endpoints, auth apps, users or roles on MariaDB (dropping the REST metadata only, never the underlying database object).
Browse and inspect existing MariaDB REST Service objects with SHOW REST commands — list services, schemas, data mapping views, procedures, functions, scripts, content sets/files, auth apps and vendors, users, roles, grants, REST Daemons and metadata schemas; check service status; list the columns a table can expose; dump the DDL (or JSON) of any object with SHOW CREATE REST. Use when asked to list, discover, inspect, audit or reverse-engineer existing REST endpoints, or to see the CREATE statement behind a REST object on MariaDB.
Update MariaDB REST Service endpoints — alter a REST service, schema, data mapping view, procedure or function; rename request paths; enable/disable; publish/unpublish a service; add/remove auth apps; merge JSON options; and drop endpoints. Use when asked to change, rename, publish, re-configure or remove existing REST SERVICE / SCHEMA / VIEW / PROCEDURE / FUNCTION endpoints on MariaDB.
MariaDB-specific syntax and behavior for REVOKE — the mirrored five-form grammar (privilege ON object, the special ALL PRIVILEGES/GRANT OPTION form with no ON clause, PROXY, role revocation, ADMIN OPTION FOR role), the USAGE-privilege gotcha, ER_NONEXISTING_GRANT on mismatched revoke level, and the absence of an IF EXISTS clause. Use when writing, generating, or reviewing REVOKE statements (privileges, roles, or proxy) against MariaDB.
Best practices when writing a MariaDB-specific database script. Use when asked to create or modify a database create script for MariaDB.
Overview of managing a MariaDB database schema across its whole lifecycle with the MariaDB Schema Management (MSM) plugin via the mariadb-shell MCP server — the versioned schema project, the MSM section model, and the create → develop → release → deploy workflow. Use when asked to create a maintainable/versioned MariaDB schema, manage schema migrations/upgrades/releases, or deploy/update a schema on a server; then read the focused sub-skill for the specific step.
Scaffold a MariaDB Schema Management (MSM) project and author the initial schema in the development folder — create the project with msm.create_project and write the first version's tables, objects and grants into the MSM sections of <schema>_next.sql. Use when starting a new versioned/maintainable MariaDB schema, creating an MSM schema project, or authoring the initial development script. Read mariadb-schema-management first for the section model.
Deploy a MariaDB Schema Management (MSM) schema version onto a live server with msm.deploy_schema — running the generated deployment script over an open db.connect connection to create the schema fresh or upgrade any prior released version to the target, optionally taking a backup first. Use when installing or upgrading an MSM-managed schema on a MariaDB server, applying a schema deployment/migration, or checking which versions are deployable. Read mariadb-schema-management first for the section model.
Develop the next version of a MariaDB Schema Management (MSM) schema in development/<schema>_next.sql, and keep large scripts maintainable by breaking section bodies out into development/sections/ files linked with the SOURCE '<path>'[start:end]; statement. Use when evolving an existing MSM schema for a new version, editing the _next.sql development script, or splitting a growing schema script into SOURCE-included section files. Read mariadb-schema-management first for the section model.
Prepare a MariaDB Schema Management (MSM) version release — snapshot the development script with msm.prepare_release, FILL the generated previous→new update script (table changes and drops in section 240, revoked privileges in 270) with the actual migration, and only then generate the deployment script with msm.generate_deployment_script. Use when cutting/preparing an MSM schema release or version, writing the release-to-release migration, or generating a deployment script. Read mariadb-schema-management first for the section model.
MariaDB-specific syntax and behavior for SELECT — optimizer hints (/*+ ... */, JOIN_PREFIX/JOIN_ORDER/JOIN_FIXED_ORDER/JOIN_SUFFIX, MAX_EXECUTION_TIME) and legacy query-level hints, LIMIT extensions (comma-form, ROWS EXAMINED), OFFSET … FETCH … ONLY/WITH TIES, FOR UPDATE / LOCK IN SHARE MODE with WAIT/NOWAIT/SKIP LOCKED, PARTITION pruning, FOR SYSTEM_TIME temporal queries, SELECT INTO OUTFILE/DUMPFILE/variable, WITH ROLLUP, max_statement_time, FROM DUAL. Covers SELECT, SELECT INTO OUTFILE, SELECT INTO DUMPFILE, SELECT … OFFSET … FETCH, and SELECT WITH ROLLUP. Use when writing, generating, or reviewing SELECT statements that target MariaDB.
MariaDB-specific syntax and behavior for SET — GLOBAL/SESSION/LOCAL scope rules and their session-isolation semantics, the SET STATEMENT ... FOR extension (and its fixed list of 13 variables it cannot touch), =/:= equivalence for user variables inside SET (but not outside it), var = DEFAULT restore semantics, the SUPER privilege gate on SET GLOBAL, and the absence of SET PERSIST (MariaDB persists via config file, not SQL). Use when writing, generating, or reviewing SET statements (system/session/user variables, options, and SET STATEMENT ... FOR) that target MariaDB.
MariaDB-specific behavior for SET TRANSACTION and transaction isolation — the GLOBAL/SESSION/next-transaction scope rule, the transaction_isolation system variable (successor to deprecated tx_isolation), READ WRITE/READ ONLY access mode, and innodb_snapshot_isolation write-write conflict detection (ON by default under REPEATABLE READ since 11.6.2, raising ER_CHECKREAD/1020 and rolling back the whole transaction). Use when writing, generating, or reviewing SET TRANSACTION statements, isolation-level configuration, or transaction retry logic that must handle MariaDB's snapshot-isolation error path.
MariaDB-specific behavior of the SHOW statement family — replication SHOW forms are spelled BINLOG STATUS/REPLICA STATUS/REPLICA HOSTS (REPLICA is a lexer-level synonym for SLAVE) while the underlying status counters still say slave/master; bare SHOW <name> is generic sugar for any plugin-registered INFORMATION_SCHEMA table (userstat, Galera, query-response-time); SHOW EXPLAIN/SHOW ANALYZE inspect another connection's live plan; only a fixed subset of SHOW forms accept LIKE/WHERE. Use when writing, generating, or reviewing SHOW statements that target MariaDB.
MariaDB string functions — extraction (SUBSTRING/SUBSTR, LEFT, RIGHT, MID, SUBSTRING_INDEX); length in bytes (LENGTH/OCTET_LENGTH/LENGTHB) vs characters (CHAR_LENGTH/CHARACTER_LENGTH); search (LOCATE, INSTR, POSITION, FIND_IN_SET, FIELD); concatenation (CONCAT, CONCAT_WS); modification (REPLACE, INSERT, REVERSE, REPEAT, SPACE, LPAD/RPAD, TRIM/LTRIM/RTRIM); case (LOWER/UPPER); PCRE2 regular expressions (REGEXP/RLIKE, REGEXP_REPLACE, REGEXP_INSTR, REGEXP_SUBSTR); formatting (FORMAT, SFORMAT); encoding (HEX/UNHEX, TO_BASE64/FROM_BASE64, ASCII, CHAR, ORD); plus the LIKE, REGEXP, SOUNDS LIKE, and BINARY operators. Use when writing SQL that searches, slices, pads, concatenates, case-folds, or pattern-matches string data in MariaDB.
Best practices for MariaDB system-versioned (temporal) tables — automatic row history built into the database. Use when tracking data changes over time, implementing audit trails, meeting GDPR or compliance requirements, doing point-in-time queries, or when the user asks about row history, data versioning, temporal tables, or querying past data states in MariaDB. This feature is unique to MariaDB among MySQL-compatible databases.
MariaDB-specific syntax and behavior for transaction control — START TRANSACTION / BEGIN [WORK], WITH CONSISTENT SNAPSHOT, READ ONLY / READ WRITE, COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE], ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE], ROLLBACK TO SAVEPOINT, SAVEPOINT, RELEASE SAVEPOINT, autocommit, implicit commit, completion_type, in_transaction, and idle transaction timeouts. Covers START TRANSACTION, BEGIN, COMMIT, ROLLBACK, and SAVEPOINT. Use when writing, generating, or reviewing transaction-control statements that target MariaDB.
MariaDB-specific syntax and behavior for TRUNCATE TABLE — DROP privilege (not DELETE), implicit commit with no rollback, unconditional AUTO_INCREMENT reset, no ON DELETE triggers, FK-parent tables rejected unless self-referencing, system-versioned tables and SEQUENCEs reject TRUNCATE outright, always '0 rows affected', and the WAIT n | NOWAIT extension. Use when writing, generating, or reviewing TRUNCATE TABLE statements that target MariaDB.
MariaDB-specific syntax and behavior for UPDATE — single-table vs multi-table forms and their different rules, UPDATE … ORDER BY … LIMIT, PARTITION pruning, RETURNING with OLD_VALUE() (since 13.0), left-to-right assignment evaluation and SIMULTANEOUS_ASSIGNMENT sql_mode, IGNORE / LOW_PRIORITY modifiers, rows-matched-vs-changed reporting, updating system-versioned and application-time-period (FOR PORTION OF) tables, and CTEs before UPDATE (since 12.3). Use when writing, generating, or reviewing UPDATE statements that target MariaDB.
Best practices for using vectors and AI with MariaDB. Use when writing SQL involving VECTOR columns, building RAG or semantic search with MariaDB, choosing embedding models, designing vector indexes, or integrating MariaDB with AI frameworks like LangChain, LlamaIndex, or Spring AI. Also use when the user mentions MariaDB and any of: vectors, embeddings, similarity search, nearest neighbor, AI, RAG, or LLM. IMPORTANT — MariaDB has native built-in vector support since version 11.7; it is NOT a plugin or extension (unlike pgvector for PostgreSQL). Do not recommend installing any extension.
MariaDB vector functions — VEC_Distance, VEC_Distance_Euclidean, VEC_Distance_Cosine, VEC_FromText, VEC_ToText, and the VECTOR data type / MHNSW vector index context. Use when writing SQL that stores, queries, or computes distances over vector embeddings in MariaDB.
MariaDB window functions — ranking (ROW_NUMBER, RANK, DENSE_RANK, PERCENT_RANK, CUME_DIST, NTILE), value navigation (LAG, LEAD, FIRST_VALUE, LAST_VALUE, NTH_VALUE), and ordered-set/inverse-distribution functions (MEDIAN, PERCENTILE_CONT, PERCENTILE_DISC), plus the OVER (PARTITION BY ... ORDER BY ... frame) clause, named windows (WINDOW w AS (...)), and ROWS/RANGE window frames. Use when writing SQL that ranks or paginates rows, computes running totals or moving aggregates, compares a row to its neighbors, or computes percentiles/medians in MariaDB.
Compatibility guide for developers moving from MySQL to MariaDB, and for developers with MySQL experience working with MariaDB. Use when migrating a MySQL application to MariaDB, when MySQL syntax or habits cause unexpected behavior in MariaDB, when asking about MySQL/MariaDB compatibility, or when adapting code written for MySQL to run on MariaDB. IMPORTANT — MariaDB diverges significantly from MySQL 8.0 and is not a simple drop-in replacement for modern MySQL. Authentication plugins, JSON handling, GTID replication, and several SQL features differ in important ways.