The source connector for MySQL can extract data change events from a MySQL database system in real-time and stream them to the DataCater platform.
The MySQL source connector is available in two variants:
The Binlog-based connector uses row-based binary logging, which is available since MySQL version 5.1.5.
Create a new MySQL user and assign the required permissions (make sure that you allow the created user to sign in from only the IP address of the machine where DataCater is running):
mysql> CREATE USER '[username]'@'[ip_of_datacater_installation]' IDENTIFIED BY '[password]';
mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '[username]'@'[ip_of_datacater_installation]' IDENTIFIED BY '[password]';
Add the following lines to the config file of your MySQL installation to enable the Binary Log:
server-id = 42 log_bin = mysql-bin binlog_format = ROW expire_logs_days = 10 # define `binlog_row_image` for MySQL 5.6 or higher, leave it out for earlier releases binlog_row_image = FULL
Create a new MySQL user and assign the required permissions (make sure that you allow the created user to sign in from only the IP address of the machine where DataCater is running):
mysql> CREATE USER '[username]'@'[ip_of_datacater_installation]' IDENTIFIED BY '[password]';
mysql> GRANT SELECT, RELOAD, SHOW DATABASES ON *.* TO '[username]'@'[ip_of_datacater_installation]' IDENTIFIED BY '[password]';
This source connector supports the following configuration options:
The hostname or IP address of the machine where the MySQL database system is running.
The port under which MySQL is available (default: 3306).
Whether to use SSL when connecting to the MySQL database or not.
The username used for authenticating with MySQL.
The password of the user used for authenticating with MySQL.
Timezone of the MySQL server (default: UTC).
The name of the database that should be used as a source.
The name of the database table that should be used as a source. You may retrieve the list of tables available in the given MySQL database by clicking on Fetch table names.
Whether to automatically profile the primary key column using the MySQL table information_schema.key_column_usage or not.
Only available if the automated detection of the primary key column is disabled. Name of the attribute that uniquely identifies records. DataCater uses the primary key attribute to detect new records. Please make sure that the column does not hold NULL values.
You may choose between the Binlog-based and JDBC-based connector variant.
Only available for the JDBC-based connector.
You may choose one of the following modes for change data capture:
Only available for the JDBC-based connector.
DataCater can use a timestamp column, which stores the time of the most recent update of a record, to detect record updates. Specifying the timestamp column is required when using TIMESTAMP/INCREMENTING as Change Data Capture mode.
Only available for the JDBC-based connector.
The interval in seconds between synchronizations of the MySQL table and DataCater (default: 60).
The following table shows the mapping between MySQL data types and the data types used by DataCater.
MySQL data type | DataCater data type |
---|---|
BIGINT | Long |
BINARY | String |
BIT | Boolean |
BLOB | String |
BOOL | Boolean |
BOOLEAN | Boolean |
CHAR | String |
DATE | Date |
DATETIME | Timestamp |
DECIMAL | Double |
DEC | Double |
DOUBLE | Double |
DOUBLE PRECISION | Double |
ENUM | String |
FIXED | Double |
FLOAT | Float |
GEOMETRY | String |
INT | Int |
INTEGER | Int |
JSON | String |
LINESTRING | String |
LONGBLOB | String |
LONGTEXT | String |
MEDIUMBLOB | String |
MEDIUMINT | Int |
MEDIUMTEXT | String |
NUMERIC | Double |
POINT | String |
POLYGON | String |
REAL | Double |
SET | String |
SMALLINT | Int |
TEXT | String |
TIME | Time |
TIMESTAMP | String |
TINYBLOB | String |
TINYINT | Int |
TINYTEXT | String |
VARBINARY | String |
VARCHAR | String |
YEAR | Int |