Skip to main content

MySQL

info

Please contact support@datafold.com if you use a MySQL version < 5.6.

info

Column-level Lineage is not currently supported for MySQL.

Steps to complete:

  1. Run SQL Script for Permissions
  2. Configure your data source in Datafold

Run SQL Script

To connect to MySql, create a user with read-only access to all tables you wish to diff. Include read and write access to a Datafold-specific dataset:

-- Create a temporary dataset for Datafold to utilize
CREATE DATABASE IF NOT EXISTS datafold_tmp;

-- Create a Datafold user
CREATE USER 'DatafoldUser'@'%' IDENTIFIED BY 'SOMESECUREPASSWORD';

-- Grant read access to diff tables in YourSchema
GRANT SELECT ON `YourSchema`.* TO 'DatafoldUser'@'%';

-- Grant read + write access to all tables in datafold_tmp database
GRANT SELECT, INSERT, UPDATE, DELETE ON `datafold_tmp`.* TO 'DatafoldUser'@'%';

-- Apply the changes
FLUSH PRIVILEGES;

Configure in Datafold

Field NameDescription
Connection nameA name given to the data source within Datafold
HostThe hostname for your MySQL instance
PortMySQL connection port; default value is 3306
UsernameThe user created in our SQL script - DatafoldUser
PasswordThe password created in our SQL script
DatabaseThe name of the MySQL database you want to connect to
Dataset for temporary tablesThe schema created in our SQL script

Click Create. Your data source is ready!