MySQL

Connect to your MySQL databases.

Getting Started

Prerequisites to create a MySQL based workflow. You will need

  1. A source MySQL connection.

  2. (optional) A list of tables OR SQL queries.

  3. (optional) A destination MySQL connection.

Create a Connection

A mysql connection is created using the following parameters:

Connection Creation Parameters

name

Display name of your choosing used to identify your connection within Gretel.

my-mysql-connection

username

Unique identifier associated with specific account authorized to access database.

john

password

Security credential to authenticate username.

...

host

Fully qualified domain name (FQDN) used to establish connection to database server.

myserver.example.com

port

Port number; If left empty, the default value - 3306- will be used.

3306

database

Name of database to connect to.

mydatabase

(optional) params

Optional JDBC URL parameters that can be used for advanced configuration.

TrustServerCertificate=True&useSSL=false

Creating Connections

First, create a file on your local computer containing the connection credentials. This file should also include type, name , config, and credentials. The config and credentials fields should contain fields that are specific to the connection being created.

Below is an example MySQL connection:

{
    "type": "mysql",
    "name": "my-mysql-connection",
    "config": {
        "username": "john",
        "host": "myserver.example.com",
        "port": 3306,
        "database": "mydatabase",
        "params": "TrustServerCertificate=True&useSSL=false"
    },
    "credentials": {
        "password": "..."
    }
}

Now that you've created the credentials file, use the CLI to create the connection

gretel connections create --project [project id] --from-file [credential_file.json]

Last updated

Was this helpful?