MySQL is a relational database management system based on SQL – Structured Query Language. The application is used for a wide range of purposes, including data warehousing, e-commerce, and logging applications.
In a YAML file, the config
section contains the following properties:
Connectorname: MySQL
host: Hostname or IP address of the server
port: Server running port
username: Username
password: Password
database: Database
drivername: mysql+pymysql
In the select section, specify the table name list to load tables from the MySQL server.
In the metadata section, define the mode of data refresh. There are two modes: INCREMENTAL and FULL_TABLE
. It only supports columns with the Date/DateTime datatype.
This mode fetches data from the date column mentioned in the replication key from the start date as mentioned in the replication value. Once it is scheduled, the replication value is updated automatically from the imported data.
metadata:
TableName:
replication_method: INCREMENTAL
replication_key: Column name
replication_value: column value that data starts from
This mode retrieves data from the specified date column in the replication key, starting from the date specified in the replication value. Once scheduled, the replication value is updated based on the interval_type and interval_value from the imported data. For instance, if the interval_type is ‘year’ and the interval_value is ‘1’, the initial schedule will fetch records from January 1, 2000 to December 31, 2000. In the subsequent schedule, it will fetch records from January 1, 2001 to December 31, 2001, and so forth.
metadata:
TableName:
replication_method: FULL_TABLE
replication_key: Column name
replication_value: column value that data starts from
interval_type: days/hours/minutes/year/month
interval_value: integer value to add in interval type
version: 1
encrypt_credentials: false
plugins:
extractors:
- name: tap_postgres
connectorname: MySQL
config:
host: Hostname or IP address of the server
port: Server running port
username: Username
password: Password
database: Database
drivername: mysql+pymysql
select:
- TABLE1
- TABLE2
metadata:
TABLE1:
replication_method: FULL_TABLE
replication_key: last_modified_on
replication_value: 2023-07-19 00:00:00
interval_type: days
interval_value: 6
TABLE2:
replication_method: FULL_TABLE
replication_key: last_modified_on
replication_value: 2023-07-19 00:00:00
interval_type: days
interval_value: 6
version: 1
encrypt_credentials: false
plugins:
extractors:
- name: tap_postgres
connectorname: MySQL
config:
host: Hostname or IP address of the server
port: Server running port
username: Username
password: Password
database: Database
drivername: mysql+pymysql
select:
- TABLE1
- TABLE2
metadata:
TABLE1:
replication_method: INCREMENTAL
replication_key: last_modified_on
replication_value: 2023-07-19 00:00:00
TABLE2:
replication_method: INCREMENTAL
replication_key: last_modified_on
replication_value: 2023-07-19 00:00:00