metadata-ingestion/docs/sources/mariadb/mariadb_pre.md
Use the MariaDB source to ingest relational metadata from MariaDB databases, including tables, views, and optional lineage/profiling signals.
localhost:3306).SELECT and SHOW VIEW).username and password).ssl_ca, ssl_cert, ssl_key) under options.connect_args.Leave database unset to ingest every database the ingestion user can see. Use database_pattern to
select which databases are ingested, for example:
database_pattern:
allow:
- "^db_one$"
- "^db_two$"
Setting database restricts ingestion to that single database; a wildcard such as * is not a valid
value for database — use database_pattern for multi-database ingestion.
With profiling enabled the source opens connections concurrently. While a database is being profiled
it can use up to pool_size (default 5) + max_overflow connections, and max_overflow defaults
to profiling.max_workers (which itself defaults to 5 × CPU count). On a production replica with a
low per-user cap this can trip an error such as
User 'USERNAME' has exceeded the 'max_user_connections' resource.
To stay within a max_user_connections limit:
profiling.max_workers (for example to 5) to cap concurrent profiling connections.options, e.g. options: {pool_size: 2, max_overflow: 5}.profiling.enabled: false) if you only need schema and lineage metadata.Set include_usage_statistics: true to derive usage statistics and query-based lineage from query
history. The usage_source config selects where that history is read from. This query-based
table-level lineage is emitted whenever usage is enabled and is independent of include_view_lineage
(which only controls view-definition lineage):
performance_schema (default) — reads normalized digests from
events_statements_summary_by_digest. No extra setup and no overhead, but query text is normalized
(literals replaced with ?) and there is no per-user attribution.
performance_schema must be enabled on the server. It is off by default in MariaDB, so start
the server with performance_schema = ON (for example --performance-schema=ON on the command
line, or performance_schema = ON in my.cnf). Once it is enabled the statements_digest
consumer is on by default. Verify with:
SELECT @@performance_schema;
SELECT * FROM performance_schema.setup_consumers WHERE NAME = 'statements_digest';
GRANT SELECT ON performance_schema.* TO 'USERNAME'@'%'.general_log — reads literal statements with the executing user and timestamp from
mysql.general_log. Use this when you need per-user attribution and exact query text, and accept
the logging overhead.
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 1;
GRANT SELECT ON mysql.general_log TO 'USERNAME'@'%'.email_domain so usage attributes
to the correct user (e.g. email_domain: corp.com maps jdoe to [email protected]).