Skip to main content

MySQL

This plugin discovers databases and tables from MySQL instances.

Status: experimental

Example Configuration


host: "mysql-prod.internal"
port: 3306
user: "marmot_user"
password: "mysql_secure_pass"
database: "ecommerce"
tls: "true"
tags:
- "mysql"
- "ecommerce"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
hoststringfalseMySQL server hostname or IP address
portintfalseMySQL server port (default: 3306)
userstringfalseUsername for authentication
passwordstringfalsePassword for authentication
databasestringfalseDatabase name to connect to
tlsstringfalseTLS configuration (false, true, skip-verify, preferred)
include_columnsboolfalseWhether to include column information in table metadata
include_row_countsboolfalseWhether to include approximate row counts
discover_foreign_keysboolfalseWhether to discover foreign key relationships
table_filterplugin.FilterfalseFilter configuration for tables

Available Metadata

The following metadata fields are available:

FieldTypeDescription
character_setstringCharacter set
charsetstringCharacter set
collationstringTable collation
collationstringCollation
column_defaultstringDefault value
column_namestringColumn name
column_typestringFull column type definition
commentstringObject comment/description
commentstringColumn comment/description
constraint_namestringForeign key constraint name
createdstringCreation timestamp
data_lengthint64Data size in bytes
data_typestringData type
databasestringDatabase name
delete_rulestringDelete rule (CASCADE, RESTRICT, etc.)
enginestringStorage engine
hoststringMySQL server hostname
index_lengthint64Index size in bytes
is_auto_incrementboolWhether column auto-increments
is_nullableboolWhether null values are allowed
is_primary_keyboolWhether column is part of primary key
object_typestringObject type (table, view)
portintMySQL server port
row_countint64Approximate row count
schemastringSchema name
source_columnstringColumn in the referencing table
source_schemastringSchema of the referencing table
source_tablestringName of the referencing table
table_namestringObject name
target_columnstringColumn in the referenced table
target_schemastringSchema of the referenced table
target_tablestringName of the referenced table
update_rulestringUpdate rule (CASCADE, RESTRICT, etc.)
updatedstringLast update timestamp
versionstringMySQL version