MySQL

The MySQL integration synchronizes metadata from your MySQL databases into the data lineage graph.

Web App

MySQL Integration

Fields

FieldValueExample
sourceThe name of the source, see sourcesmy-source
NameName for connectionPostgres
NamespaceNamespace for the connection, see namespacesdefault
hostDatabase hostsample-database.cudyk77thtpt.us-west-2.rds.amazonaws.com
portDatabase port3306
Database NameDatabase Namejaffle_shop
userDatabase user
passwordDatabase password
ℹī¸

Your database will need to be accessible from wherever you are running the Grai server. If you are using Grai Cloud your database will need to be accessible from the internet.

Python Library

The Metabase integration can be run as a standalone python library to extract data lineage from your instance of MySQL.

The library is available via pip

pip install grai_source_mysql

More information about the API is available here.

Example

The library is split into a few distinct functions but if you only wish to extract nodes/edges you can do so as follows:

  from grai_source_mysql import MySQLIntegration
  from grai_schemas.v1.source import SourceV1
 
  source = SourceV1(name="my-source", type="my-type")
  mysql_params = {
    "username": "my-username",
    "password": "my-password",
    "host": "https://prod.yourdomain.com",
    "port": 3306
  }
 
  integration = MySQLIntegration(source=source, namespace="metabase", **mysql_params)
 
  nodes, edges = integration.get_nodes_and_edges()