MySQL

MySQL can either be used as a data source or a data destination in Zuar Runner.

Zuar Runner and MySQL

Source plugin example: Query

Destination plugin examples: CSV, Salesforce, SQL

MySQL as a Data Destination

  • Zuar Runner automatically creates the MySQL database if it doesn’t exist

  • Zuar Runner automatically creates the MySQL database tables if they don’t exist

  • Zuar Runner automatically determines data types for MySQL columns

  • Zuar Runner automatically adds new columns to MySQL tables based on new fields in source systems

MySQL Specific Setup

Below is the database url structure for connecting to a MySQL database:

mysql+pymysql://<username>:<password>@<hostname>/<database>

Here’s an example of using a MySQL database as a destination in a CSV job:

CSV job with MySQL

Note

Unlike databases like PostgreSQL , MySQL doesn’t have the concept of schemas.

When using MySQL as an input or output database, you have two options:

  1. Leave “Schema“ blank and append the database name to the end of the database URL.

    "output": {
    "dbo": "mysql+pymsql://{user}:{password}@{host}:{port}/{database}",
    "tablename": "{tablename}",
    ...
    }
    
  2. Put the database name in the “schema” section and remove it from the end of the database URL.

    "output": {
    "dbo": "mysql+pymsql://{user}:{password}@{host}:{port}/",
    "schema": "{database}",
    "tablename": "{tablename}",
    ...
    }
    

SQL

Zuar Runner can send SQL statements to a MySQL database. Use MySQL syntax in these Zuar Runner SQL jobs.